Use C++11 static_assert when available
This commit is contained in:
@@ -44,8 +44,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Compile-time Assert
|
// Compile-time Assert
|
||||||
#if __STDC_VERSION__ >= 201112L
|
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||||
#define TU_VERIFY_STATIC _Static_assert
|
#define TU_VERIFY_STATIC _Static_assert
|
||||||
|
#elif defined (__cplusplus) && __cplusplus >= 201103L
|
||||||
|
#define TU_VERIFY_STATIC static_assert
|
||||||
#else
|
#else
|
||||||
#define TU_VERIFY_STATIC(const_expr, _mess) enum { TU_XSTRCAT(_verify_static_, _TU_COUNTER_) = 1/(!!(const_expr)) }
|
#define TU_VERIFY_STATIC(const_expr, _mess) enum { TU_XSTRCAT(_verify_static_, _TU_COUNTER_) = 1/(!!(const_expr)) }
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user