libowfat/compiletimeassert.h

17 lines
340 B
C
Raw Normal View History

2013-02-22 11:00:32 +00:00
2020-04-17 07:50:37 +00:00
#if __STDC_VERSION__ >= 201710L
2020-04-08 11:37:31 +00:00
#define compiletimeassert(cond) _Static_assert(cond)
2020-04-17 07:50:37 +00:00
#elif __STDC_VERSION__ >= 201112L
#define compiletimeassert(cond) _Static_assert(cond,"")
2020-04-08 11:37:31 +00:00
#else
2013-02-22 11:00:32 +00:00
#define __X(x, y) x ## y
#define __Y(x, y) __X(x, y)
#define compiletimeassert(cond) struct __Y(foo,__LINE__) { char __temp[1 - (!(cond))*2]; };
2020-04-08 11:37:31 +00:00
#endif