From 7eb70a453b4ea797d9e85017c6deab6a7bc903a6 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Fri, 7 Aug 2020 20:42:34 +0100 Subject: Replace GCC "unused" and "format" attributes with portable macros --- macros.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'macros.h') diff --git a/macros.h b/macros.h index c8990858..323b3748 100644 --- a/macros.h +++ b/macros.h @@ -20,6 +20,12 @@ #define HAS_BUILTIN(x) 0 #endif +#if GNUC_AT_LEAST(3, 0) || HAS_ATTRIBUTE(unused) || defined(__TINYC__) + #define UNUSED __attribute__((__unused__)) +#else + #define UNUSED +#endif + #if GNUC_AT_LEAST(3, 0) || HAS_ATTRIBUTE(malloc) #define MALLOC __attribute__((__malloc__)) #else -- cgit v1.3