aboutsummaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-07 19:55:41 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-08-07 19:55:41 +0000
commit42ba135dcbf905a1e3b589c1012cfc946ad28d42 (patch)
tree265282027801e799b9a4a3afba074c868689b49e /macros.h
parentMerge branch 'syslog' into master (diff)
parentReplace GCC "unused" and "format" attributes with portable macros (diff)
Merge branch 'attrs' into master
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/macros.h b/macros.h
index c8990858..323b3748 100644
--- a/macros.h
+++ b/macros.h
@@ -20,6 +20,12 @@
#define HAS_BUILTIN(x) 0
#endif
+#if GNUC_AT_LEAST(3, 0) || HAS_ATTRIBUTE(unused) || defined(__TINYC__)
+ #define UNUSED __attribute__((__unused__))
+#else
+ #define UNUSED
+#endif
+
#if GNUC_AT_LEAST(3, 0) || HAS_ATTRIBUTE(malloc)
#define MALLOC __attribute__((__malloc__))
#else