diff options
| author | Craig Barnes <craigbarnes@protonmail.com> | 2021-01-03 08:56:47 +0000 |
|---|---|---|
| committer | Craig Barnes <craigbarnes@protonmail.com> | 2021-01-03 08:56:47 +0000 |
| commit | 39b2e46e72ad82ec2971b859eae75562751f8464 (patch) | |
| tree | b9e7a0ebefda5d9e485f4c779ddc3ee80c85ed17 /macros.h | |
| parent | macros: add wrappers for more GCC/Clang attributes/pragmas/builtins (diff) | |
Use wrappers from macros.h instead of bare GCC attributes/pragmas
Diffstat (limited to 'macros.h')
| -rw-r--r-- | macros.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -45,6 +45,18 @@ #define MALLOC #endif +#if GNUC_AT_LEAST(3, 0) || HAS_ATTRIBUTE(constructor) + #define CONSTRUCTOR __attribute__((__constructor__)) +#else + #define CONSTRUCTOR +#endif + +#if GNUC_AT_LEAST(3, 0) || HAS_ATTRIBUTE(destructor) + #define DESTRUCTOR __attribute__((__destructor__)) +#else + #define DESTRUCTOR +#endif + #if GNUC_AT_LEAST(3, 0) || HAS_ATTRIBUTE(format) #define PRINTF(x) __attribute__((__format__(__printf__, (x), (x + 1)))) #define VPRINTF(x) __attribute__((__format__(__printf__, (x), 0))) |
