For gcc 4.6 and newer, _Static_assert is a keyword, so don't try to

redefine it. It does what we want, and is always available unlike
other alternatives.
This commit is contained in:
imp 2014-10-10 00:35:13 +00:00
parent a2b4dd0675
commit f7d13532c9
2 changed files with 3 additions and 1 deletions

View File

@ -38,7 +38,7 @@ CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
# building with gcc 4.8 and newer. Nothing older has been tested.
CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable \
-Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized \
-Wno-error=unused-local-typedefs -Wno-error=array-bounds -Wno-error=address \
-Wno-error=array-bounds -Wno-error=address \
-Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes
.endif

View File

@ -288,6 +288,8 @@
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
__has_extension(cxx_static_assert)
#define _Static_assert(x, y) static_assert(x, y)
#elif __GNUC_PREREQ__(4,6)
/* Nothing, gcc 4.6 and higher has _Static_assert built-in */
#elif defined(__COUNTER__)
#define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
#define __Static_assert(x, y) ___Static_assert(x, y)