summaryrefslogtreecommitdiff
path: root/src/common/cbasetypes.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-04-05 15:20:39 +0200
committerHaru <haru@dotalux.com>2016-04-05 15:25:00 +0200
commit7199849cd294ca3d2b7d30f59c27fa03412e5812 (patch)
tree77c2e5ce7a7e5296cd566f9068592b90647de040 /src/common/cbasetypes.h
parent187c0b6b288a6a4267aeb949e054dd8fabde6627 (diff)
downloadhercules-7199849cd294ca3d2b7d30f59c27fa03412e5812.tar.gz
hercules-7199849cd294ca3d2b7d30f59c27fa03412e5812.tar.bz2
hercules-7199849cd294ca3d2b7d30f59c27fa03412e5812.tar.xz
hercules-7199849cd294ca3d2b7d30f59c27fa03412e5812.zip
Disabled some #pragma GCC diagnostic on versions that don't support them
- Fixes compilation on gcc 4.4 for the brave ones who still want to use it (we recommend gcc 4.7 or newer) - Removes some warnings about unknown pragmas on MSVC Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/cbasetypes.h')
-rw-r--r--src/common/cbasetypes.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 6843ce486..3675d8fa4 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -295,6 +295,21 @@ typedef uintptr_t uintptr;
#define analyzer_noreturn
#endif
+// gcc version (if any) - borrowed from Mana Plus
+#ifdef __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+#else
+#define GCC_VERSION 0
+#endif
+
+// Pragma macro only enabled on gcc >= 4.5 or clang - borrowed from Mana Plus
+#if defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500)
+#define PRAGMA_GCC45(str) _Pragma(#str)
+#else // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500)
+#define PRAGMA_GCC45(str)
+#endif // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500)
// boolean types for C
#if !defined(_MSC_VER) || _MSC_VER >= 1800