mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/macros: Drop alternative definition of BUILD_BUG_ON(_ZERO)? for old GCC
The toolchain baseline for GCC is 5.1, which supports _Static_assert in c99 mode No functional change. Signed-off-by: Nicola Vetrini <nicola.vetrini@gmail.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
900d422775
commit
b979189a67
1 file changed
-8
@@ -40,9 +40,6 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* All clang versions supported by Xen have _Static_assert. */
|
||||
#if defined(__clang__) || \
|
||||
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
||||
/* Force a compilation error if condition is true */
|
||||
#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); })
|
||||
|
||||
@@ -54,11 +51,6 @@
|
||||
*/
|
||||
#define BUILD_BUG_ON_ZERO(cond) \
|
||||
(sizeof(struct { char c; _Static_assert(!(cond), "!(" #cond ")"); }) & 0)
|
||||
#else
|
||||
#define BUILD_BUG_ON_ZERO(cond) \
|
||||
(sizeof(struct { unsigned u : !(cond); }) & 0)
|
||||
#define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Force a compilation error. This is for code which, in the normal case,
|
||||
|
||||