diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-02-17 13:33:28 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-02-17 13:33:28 +0100 |
commit | 4bcd6157b2b44e700dd824d58248f4a98b2c536e (patch) | |
tree | 1761be18ddf79ec7cd93d171dc566e7f1c7771be /compiler.h | |
parent | db991f91447e16f6ad22974a6c599ae9e47a95eb (diff) |
compiler: Protect against redefinition of offsetof()
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'compiler.h')
-rw-r--r-- | compiler.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -20,10 +20,12 @@ #define COMPILER_H #ifdef __GNUC__ -# define __noreturn __attribute__((noreturn)) -# define __packed __attribute__((packed)) -# define __unused __attribute__((unused)) -# define offsetof(a, b) __builtin_offsetof(a, b) +# define __noreturn __attribute__((noreturn)) +# define __packed __attribute__((packed)) +# define __unused __attribute__((unused)) +# ifndef offsetof +# define offsetof(a, b) __builtin_offsetof(a, b) +# endif #else # define __noreturn # define __packed |