diff options
author | Chris Robinson <[email protected]> | 2015-03-02 23:05:25 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-03-02 23:05:25 -0800 |
commit | 19f79be57b8e768f44710b6d26017bc1f8c8fbda (patch) | |
tree | 3f9a70499deb8ac112a1408922c49be0c6733181 | |
parent | 6fcaccc96414de5a0c4578b594bdc244f7b96058 (diff) |
Fix static_assert when __COUNTER__ isn't available
-rw-r--r-- | include/static_assert.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/static_assert.h b/include/static_assert.h index 12a095a3..bf0ce065 100644 --- a/include/static_assert.h +++ b/include/static_assert.h @@ -7,13 +7,15 @@ #ifndef static_assert #ifdef HAVE_C11_STATIC_ASSERT #define static_assert _Static_assert -#elif defined(__COUNTER__) +#else #define CTASTR2(_pre,_post) _pre##_post #define CTASTR(_pre,_post) CTASTR2(_pre,_post) +#if defined(__COUNTER__) #define static_assert(_cond, _msg) typedef struct { int CTASTR(static_assert_failed_at_line_,__LINE__) : !!(_cond); } CTASTR(static_assertion_,__COUNTER__) #else #define static_assert(_cond, _msg) struct { int CTASTR(static_assert_failed_at_line_,__LINE__) : !!(_cond); } #endif #endif +#endif #endif /* AL_STATIC_ASSERT_H */ |