diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-07-07 21:31:55 +0200 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-07-07 23:30:31 +0200 |
commit | 9eb61809638db2d6cf4068b8509c46a4632b925c (patch) | |
tree | 63b771347ff740ad3da5195a658d0a7815afe660 | |
parent | 0fa5d8f219a016d58e4592c268730d0f45a2835b (diff) | |
download | coreboot-9eb61809638db2d6cf4068b8509c46a4632b925c.tar.xz |
stddef.h: Disable check_member() macro when compiling with CLANG
CLANG assumes that _Static_assert() is a C++11 only feature and
errs out when encountering the check_member macro complaining about
a reinterpret_cast.
Change-Id: Id8c6b47b4f5716e6184aec9e0bc4b0e1c7aaf17c
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10827
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
-rw-r--r-- | src/include/stddef.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/stddef.h b/src/include/stddef.h index 3bbf914246..f87c65f089 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -32,9 +32,13 @@ typedef unsigned int wint_t; #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#if !defined(__clang__) #define check_member(structure, member, offset) _Static_assert( \ offsetof(struct structure, member) == offset, \ "`struct " #structure "` offset for `" #member "` is not " #offset ) +#else +#define check_member(structure, member, offset) +#endif /** * container_of - cast a member of a structure out to the containing structure |