From 7733df13ec32c169f4f8013bb1c3f55743d88c87 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 21 Apr 2022 17:39:09 -0400 Subject: Move attribute definitions to a separate header --- src/attributes.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/attributes.h (limited to 'src/attributes.h') 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 +// 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 -- cgit v1.2.1