summaryrefslogtreecommitdiffstats
path: root/zix/common.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-13 17:25:39 +0200
committerDavid Robillard <d@drobilla.net>2020-08-13 17:25:39 +0200
commit56b8eb22da76b58a60a797994cecb6499e236896 (patch)
tree38ac10bd2a0465340535397567a150098cc62423 /zix/common.h
parentc64c8bb33042f2e49eea2efb6e4bbff812e955c1 (diff)
downloadzix-56b8eb22da76b58a60a797994cecb6499e236896.tar.gz
zix-56b8eb22da76b58a60a797994cecb6499e236896.tar.bz2
zix-56b8eb22da76b58a60a797994cecb6499e236896.zip
Fix unused parameter warnings
Diffstat (limited to 'zix/common.h')
-rw-r--r--zix/common.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/zix/common.h b/zix/common.h
index a59c033..f0737eb 100644
--- a/zix/common.h
+++ b/zix/common.h
@@ -52,10 +52,13 @@ extern "C" {
# include <stdbool.h>
#endif
-#ifdef __GNUC__
-#define ZIX_UNUSED __attribute__((__unused__))
+// Unused parameter macro to suppresses warnings and make it impossible to use
+#if defined(__cplusplus)
+# define ZIX_UNUSED(name)
+#elif defined(__GNUC__)
+# define ZIX_UNUSED(name) name##_unused __attribute__((__unused__))
#else
-#define ZIX_UNUSED
+# define ZIX_UNUSED(name) name
#endif
typedef enum {