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

@@ -171,11 +171,15 @@
 #define PRINT_MASK_HOTPLUG      0x00000080
 #define PRINT_MASK_DEVCTRL      0x00000100
 #define PRINT_MASK_DEVMAP       0x00000200
 #define PRINT_MASK_ALL          0xFFFFFFFF
 
+#if defined(__GNUC__)
+#define offsetof(s, m)  __builtin_offsetof(s, m)
+#else
 #define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
+#endif
 
 #define USBVC_MAX_PKTS 40
 
 #define USBVC_DEFAULT_READ_BUF_NUM 3
 #define USBVC_MAX_READ_BUF_NUM 40