diff options
Diffstat (limited to '')
| -rw-r--r-- | src/utils/compilers.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/utils/compilers.h b/src/utils/compilers.h index a7d6df5..1b175bb 100644 --- a/src/utils/compilers.h +++ b/src/utils/compilers.h | |||
| @@ -1,13 +1,24 @@ | |||
| 1 | #if defined(__GNUC__) | 1 | #if defined(__GNUC__) |
| 2 | 2 | ||
| 3 | #define unused __attribute__((unused)) | 3 | #define UNUSED __attribute__((unused)) |
| 4 | #define SIZE(x) static (x) | ||
| 5 | #define NON_NULL SIZE(1) | ||
| 4 | 6 | ||
| 5 | #elif defined(__clang__) | 7 | #elif defined(__clang__) |
| 6 | 8 | ||
| 7 | #define unused __attribute__((unused)) | 9 | #define UNUSED __attribute__((unused)) |
| 10 | #define SIZE(x) static (x) | ||
| 11 | #define NON_NULL SIZE(1) | ||
| 8 | 12 | ||
| 9 | #else | 13 | #else |
| 10 | 14 | ||
| 11 | #define unused | 15 | /* |
| 16 | For example MSVC, which is not fully C11 compliant (e.g. it does not support | ||
| 17 | a[static N] notation for array parameters). | ||
| 18 | */ | ||
| 19 | |||
| 20 | #define UNUSED | ||
| 21 | #define SIZE(x) | ||
| 22 | #define NON_NULL | ||
| 12 | 23 | ||
| 13 | #endif | 24 | #endif |
