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:
Nicola Vetrini authored and Jan Beulich committed 2025-08-14 11:36:44 +02:00
1 parent 900d422775
commit b979189a67
1 file changed
-8
-8
View File
@@ -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,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.