diff options
| author | Tyge Løvset <[email protected]> | 2023-01-02 22:36:51 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-01-02 22:36:51 +0100 |
| commit | 16e004c62f8d8d502152a85b2ffd384a1c91a470 (patch) | |
| tree | 368ed5b319c18f88d0ae2e8c291b0c3889ac72c5 /include/stc | |
| parent | 364b8833cb5d91bbe2c7640869912cde4de12846 (diff) | |
| download | STC-modified-16e004c62f8d8d502152a85b2ffd384a1c91a470.tar.gz STC-modified-16e004c62f8d8d502152a85b2ffd384a1c91a470.zip | |
Replaced c_STATIC_ASSERT() which works for C99 (also multiple on same line).
Some regex updates.
Diffstat (limited to 'include/stc')
| -rw-r--r-- | include/stc/ccommon.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index ce6bba84..9cdbc9e5 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -56,14 +56,13 @@ #define c_PASTE(a, b) c_CONCAT(a, b) #define c_EXPAND(...) __VA_ARGS__ #define c_NUMARGS(...) _c_APPLY_ARG_N((__VA_ARGS__, _c_RSEQ_N)) - #define _c_APPLY_ARG_N(args) c_EXPAND(_c_ARG_N args) #define _c_RSEQ_N 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 #define _c_ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, \ _14, _15, _16, N, ...) N -#define c_STATIC_ASSERT(cond) \ - typedef char c_PASTE(_static_assert_line_, __LINE__)[(cond) ? 1 : -1] +#define c_STATIC_ASSERT(cond, msg) \ + ((void)sizeof(int[(cond) ? 1 : -1])) #define c_CONTAINER_OF(p, T, m) \ ((T*)((char*)(p) + 0*sizeof((p) == &((T*)0)->m) - offsetof(T, m))) |
