aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/attributes.h')
-rw-r--r--src/attributes.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/attributes.h b/src/attributes.h
new file mode 100644
index 0000000..684ee27
--- /dev/null
+++ b/src/attributes.h
@@ -0,0 +1,16 @@
+// Copyright 2012-2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef PUGL_SRC_ATTRIBUTES_H
+#define PUGL_SRC_ATTRIBUTES_H
+
+// Unused parameter macro to suppresses warnings and make it impossible to use
+#if defined(__cplusplus)
+# define PUGL_UNUSED(name)
+#elif defined(__GNUC__) || defined(__clang__)
+# define PUGL_UNUSED(name) name##_unused __attribute__((__unused__))
+#else
+# define PUGL_UNUSED(name) name
+#endif
+
+#endif // PUGL_SRC_ATTRIBUTES_H