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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/usb/clients/video/usbvc/usbvc_var.h
          +++ new/usr/src/uts/common/sys/usb/clients/video/usbvc/usbvc_var.h
↓ open down ↓ 165 lines elided ↑ open up ↑
 166  166  #define PRINT_MASK_CLOSE        0x00000004
 167  167  #define PRINT_MASK_READ         0x00000008
 168  168  #define PRINT_MASK_IOCTL        0x00000010
 169  169  #define PRINT_MASK_PM   0x00000020
 170  170  #define PRINT_MASK_CB   0x00000040
 171  171  #define PRINT_MASK_HOTPLUG      0x00000080
 172  172  #define PRINT_MASK_DEVCTRL      0x00000100
 173  173  #define PRINT_MASK_DEVMAP       0x00000200
 174  174  #define PRINT_MASK_ALL          0xFFFFFFFF
 175  175  
      176 +#if defined(__GNUC__)
      177 +#define offsetof(s, m)  __builtin_offsetof(s, m)
      178 +#else
 176  179  #define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
      180 +#endif
 177  181  
 178  182  #define USBVC_MAX_PKTS 40
 179  183  
 180  184  #define USBVC_DEFAULT_READ_BUF_NUM 3
 181  185  #define USBVC_MAX_READ_BUF_NUM 40
 182  186  #define USBVC_MAX_MAP_BUF_NUM 40
 183  187  
 184  188  /* According to UVC specs, the frame interval is in 100ns unit */
 185  189  #define USBVC_FRAME_INTERVAL_DENOMINATOR        10000000
 186  190  
↓ open down ↓ 206 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX