summaryrefslogtreecommitdiff
path: root/zen/warn_static.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2018-06-30 12:43:08 +0200
committerDaniel Wilhelm <shieldwed@outlook.com>2018-06-30 12:43:08 +0200
commita98326eb2954ac1e79f5eac28dbeab3ec15e047f (patch)
treebb16257a1894b488e365851273735ec13a9442ef /zen/warn_static.h
parent10.0 (diff)
downloadFreeFileSync-a98326eb2954ac1e79f5eac28dbeab3ec15e047f.tar.gz
FreeFileSync-a98326eb2954ac1e79f5eac28dbeab3ec15e047f.tar.bz2
FreeFileSync-a98326eb2954ac1e79f5eac28dbeab3ec15e047f.zip
10.1
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