Print this page
2976 remove useless offsetof() macros

@@ -50,10 +50,11 @@
 #include <sys/ddi.h>
 #include <sys/sunddi.h>
 #include <sys/stream.h>         /* required for MBLK* */
 #include <sys/strsun.h>         /* required for mionack() */
 #include <sys/byteorder.h>
+#include <sys/sysmacros.h>
 #include <sys/pci.h>
 #include <inet/common.h>
 #include <inet/led.h>
 #include <inet/mi.h>
 #include <inet/nd.h>

@@ -105,13 +106,10 @@
 #endif
 
 #define GET_TXBUF(dp, sn)       \
         &(dp)->tx_buf[SLOT((dp)->tx_slots_base + (sn), (dp)->gc.gc_tx_buf_size)]
 
-#ifndef offsetof
-#define offsetof(t, m)  ((long)&(((t *) 0)->m))
-#endif
 #define TXFLAG_VTAG(flag)       \
         (((flag) & GEM_TXFLAG_VTAG) >> GEM_TXFLAG_VTAG_SHIFT)
 
 #define MAXPKTBUF(dp)   \
         ((dp)->mtu + sizeof (struct ether_header) + VTAG_SIZE + ETHERFCSL)