summaryrefslogtreecommitdiff
path: root/src/stdafx.h
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-10-25 12:32:42 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-10-25 12:32:42 +0000
commit28bd8a3d83866c38ce6e2933da74232b9ae30419 (patch)
tree4513495d77ef7a52c19d97e49ee881893e4f3aa8 /src/stdafx.h
parent9c2e4c14085587e6ee4150b8682e2f90b5f1a468 (diff)
downloadopenttd-28bd8a3d83866c38ce6e2933da74232b9ae30419.tar.xz
(svn r27040) -Fix: Don't use GCC diagnostic push/pop if unsupported
Diffstat (limited to 'src/stdafx.h')
-rw-r--r--src/stdafx.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 776031219..d26b05c3f 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -498,12 +498,16 @@ static inline void free(const void *ptr)
#define HELPER0(x) #x
#define HELPER1(x) HELPER0(GCC diagnostic ignored x)
#define HELPER2(y) HELPER1(#y)
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#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
+#endif
+#endif
+
+#ifndef IGNORE_UNINITIALIZED_WARNING_START
#define IGNORE_UNINITIALIZED_WARNING_START
#define IGNORE_UNINITIALIZED_WARNING_STOP
#endif