Print this page
3373 gcc >= 4.5 concerns about offsetof()

@@ -51,11 +51,15 @@
 #include <sys/systeminfo.h>
 #include <sys/ddi.h>
 #include <sys/time.h>
 #include <sys/promif.h>
 
-#define offsetof(s, m)  (size_t)(&(((s *)0)->m))
+#if defined(__GNUC__)
+#define offsetof(s, m)  __builtin_offsetof(s, m)
+#else
+#define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
+#endif
 #define RMCRESBUFLEN    1024
 #define DATE_TIME_MSG_SIZE      78
 #define RMCLOMV_WATCHDOG_MODE   "rmclomv-watchdog-mode"
 #define DELAY_TIME      5000000  /* 5 seconds, in microseconds */
 #define CPU_SIGNATURE_DELAY_TIME        5000000  /* 5 secs, in microsecs */