summaryrefslogtreecommitdiff
path: root/zen/warn_static.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/warn_static.h')
-rwxr-xr-xzen/warn_static.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/zen/warn_static.h b/zen/warn_static.h
index e4931c08..6f0a2691 100755
--- a/zen/warn_static.h
+++ b/zen/warn_static.h
@@ -14,13 +14,11 @@ Usage:
warn_static("my message")
*/
-#if defined __GNUC__
-#define STATIC_WARNING_CONCAT_SUB(X, Y) X ## Y
-#define STATIC_WARNING_CONCAT(X, Y) STATIC_WARNING_CONCAT_SUB(X, Y)
+#define ZEN_STATIC_WARNING_STRINGIZE(NUM) #NUM
-#define warn_static(TXT) \
- typedef int STATIC_WARNING_87903124 __attribute__ ((deprecated)); \
- enum { STATIC_WARNING_CONCAT(warn_static_dummy_value, __LINE__) = sizeof(STATIC_WARNING_87903124) };
+#if defined __GNUC__ //Clang also defines __GNUC__!
+#define warn_static(MSG) \
+ _Pragma(ZEN_STATIC_WARNING_STRINGIZE(GCC warning MSG))
#endif
#endif //WARN_STATIC_H_08724567834560832745
bgstack15