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

@@ -48,11 +48,15 @@
 /* For logging. */
 #define UWBA_LOG_DEBUG          2
 #define UWBA_LOG_LOG            1
 #define UWBA_LOG_CONSOLE        0
 
+#if defined(__GNUC__)
+#define offsetof(s, m)  __builtin_offsetof(s, m)
+#else
 #define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
+#endif
 #define isdigit(ch) ((ch >= '0') && (ch <= '9'))
 
 #define UWB_RAW_RESULT_CODE_SIZE        5  /* size of RCEB + bResultCode */
 #define UWB_RAW_RCCB_HEAD_SIZE          4  /* size of RCCB */