summaryrefslogtreecommitdiff
path: root/src/stdafx.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdafx.h')
-rw-r--r--src/stdafx.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 5464c59fa..30facd337 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -490,4 +490,21 @@ static inline void free(const void *ptr)
*/
#define MAX_UVALUE(type) ((type)~(type)0)
+#if defined(_MSC_VER) && !defined(_DEBUG)
+ #define IGNORE_UNINITIALIZED_WARNING_START __pragma(warning(push)) __pragma(warning(disable:4700))
+ #define IGNORE_UNINITIALIZED_WARNING_STOP __pragma(warning(pop))
+#elif defined(__GNUC__) && !defined(_DEBUG)
+ #define HELPER0(x) #x
+ #define HELPER1(x) HELPER0(GCC diagnostic ignored x)
+ #define HELPER2(y) HELPER1(#y)
+ #define IGNORE_UNINITIALIZED_WARNING_START \
+ _Pragma("GCC diagnostic push") \
+ _Pragma(HELPER2(-Wuninitialized)) \
+ _Pragma(HELPER2(-Wmaybe-uninitialized))
+ #define IGNORE_UNINITIALIZED_WARNING_STOP _Pragma("GCC diagnostic pop")
+#else
+ #define IGNORE_UNINITIALIZED_WARNING_START
+ #define IGNORE_UNINITIALIZED_WARNING_STOP
+#endif
+
#endif /* STDAFX_H */