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 ++++++++++++++++ src/types.h | 11 +---------- src/x11_gl.c | 3 ++- src/x11_vulkan.c | 3 ++- 4 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 src/attributes.h (limited to 'src') 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 diff --git a/src/types.h b/src/types.h index aa17b7f..e4ca16b 100644 --- a/src/types.h +++ b/src/types.h @@ -1,4 +1,4 @@ -// Copyright 2012-2020 David Robillard +// Copyright 2012-2022 David Robillard // SPDX-License-Identifier: ISC #ifndef PUGL_SRC_TYPES_H @@ -10,15 +10,6 @@ #include #include -// 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 - /// Platform-specific world internals typedef struct PuglWorldInternalsImpl PuglWorldInternals; diff --git a/src/x11_gl.c b/src/x11_gl.c index 0e34a66..06e2b22 100644 --- a/src/x11_gl.c +++ b/src/x11_gl.c @@ -1,6 +1,7 @@ -// Copyright 2012-2021 David Robillard +// Copyright 2012-2022 David Robillard // SPDX-License-Identifier: ISC +#include "attributes.h" #include "stub.h" #include "types.h" #include "x11.h" diff --git a/src/x11_vulkan.c b/src/x11_vulkan.c index 0b9c50b..72ff701 100644 --- a/src/x11_vulkan.c +++ b/src/x11_vulkan.c @@ -1,8 +1,9 @@ -// Copyright 2012-2021 David Robillard +// Copyright 2012-2022 David Robillard // SPDX-License-Identifier: ISC #define VK_NO_PROTOTYPES 1 +#include "attributes.h" #include "stub.h" #include "types.h" #include "x11.h" -- cgit v1.2.1