Even though it's just two lines of code, I'm reimplementing it
cleanly out of paranoia.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* to redistribute under later versions of GPL might not be available.
*/
+#include <urcu/compiler.h>
#include <urcu/arch.h>
-#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
-#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
-
/*
* Machine parameters.
*/
(type *)((char *)__ptr - offsetof(type, member)); \
})
+#define CAA_BUILD_BUG_ON_ZERO(cond) (sizeof(struct { int:-!!(cond); }))
+#define CAA_BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
+
#endif /* _URCU_COMPILER_H */