diff options
author | Richard Lowe <richlowe@richlowe.net> | 2012-06-28 04:06:02 +0100 |
---|---|---|
committer | Richard Lowe <richlowe@richlowe.net> | 2016-03-05 10:41:12 -0500 |
commit | 876de206688d9fe008ad80c116a23a56701579d1 (patch) | |
tree | 8e0db5218f1b7f459e1920bcd9d16e3c524fa432 /usr/src/uts/common/sys/sysmacros.h | |
parent | 38379e9254628617dd4995589f23b06c84ffe16e (diff) | |
download | illumos-joyent-876de206688d9fe008ad80c116a23a56701579d1.tar.gz |
3373 gcc >= 4.5 concerns about offsetof()
Portions contributed by: Igor Pashev <pashev.igor@gmail.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Andy Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/uts/common/sys/sysmacros.h')
-rw-r--r-- | usr/src/uts/common/sys/sysmacros.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/sysmacros.h b/usr/src/uts/common/sys/sysmacros.h index b565968dda..2e895a8daf 100644 --- a/usr/src/uts/common/sys/sysmacros.h +++ b/usr/src/uts/common/sys/sysmacros.h @@ -370,7 +370,11 @@ extern unsigned char bcd_to_byte[256]; #if (defined(_KERNEL) || defined(_FAKE_KERNEL)) && !defined(_KMEMUSER) #if !defined(offsetof) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#define offsetof(s, m) __builtin_offsetof(s, m) +#else #define offsetof(s, m) ((size_t)(&(((s *)0)->m))) +#endif #endif /* !offsetof */ #define container_of(m, s, name) \ |