aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-04-21 17:39:09 -0400
committerDavid Robillard <d@drobilla.net>2022-04-21 17:40:12 -0400
commit7733df13ec32c169f4f8013bb1c3f55743d88c87 (patch)
tree3a0cf22eb132f95d3424261330b534c31ccfe078 /src/attributes.h
parentec7a751fac40d07eba3bac1dc4d1c7f4235adc52 (diff)
downloadpugl-7733df13ec32c169f4f8013bb1c3f55743d88c87.tar.gz
pugl-7733df13ec32c169f4f8013bb1c3f55743d88c87.tar.bz2
pugl-7733df13ec32c169f4f8013bb1c3f55743d88c87.zip
Move attribute definitions to a separate header
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