Replace GCC "unused" and "format" attributes with portable macros

This commit is contained in:
Craig Barnes 2020-08-07 20:42:34 +01:00
parent f952d5a305
commit 7eb70a453b
7 changed files with 18 additions and 10 deletions

View file

@ -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