summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-02-03 11:28:44 +0100
committerTobias Klauser <tklauser@distanz.ch>2016-02-03 11:28:44 +0100
commitb14fd7ed1bdbe0644601b9f0e854af1b19811f30 (patch)
tree9aeed4e6bc714754e70343338e888b7eb071edff
parent83c1bb0a8271338c57ab1c7d9d9bc3e53aafb314 (diff)
built_in: Include stddef.h to avoid redefinition of offsetof() macro
The stddef.h header might define the offsetof() macro unconditionally, leading to the macro being redefined if built_in.h is included _before_ stddef.h. This will lead sparse to complain as follows: /usr/lib/gcc/x86_64-linux-gnu/4.8//include/stddef.h:413:9: warning: preprocessor token offsetof redefined ./built_in.h:151:10: this was the original definition Fix this by explicitly including stddef.h in built_in.h Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--built_in.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/built_in.h b/built_in.h
index 6ebf27e..d10579a 100644
--- a/built_in.h
+++ b/built_in.h
@@ -3,12 +3,13 @@
/* Parts taken from the Linux kernel, GPL, version 2. */
+#include <stddef.h>
+#include <stdint.h>
#include <linux/if_packet.h>
#include <assert.h>
#include <endian.h>
#include <byteswap.h>
#include <asm/byteorder.h>
-#include <stdint.h>
typedef uint64_t u64;
typedef uint32_t u32;