Print this page
2976 remove useless offsetof() macros

@@ -33,10 +33,11 @@
 #include <locale.h>
 #include <string.h>
 #include <ctype.h>
 #include <limits.h>
 #include <errno.h>
+#include <stddef.h>
 
 #include <pool.h>
 #include "utils.h"
 #include "poolstat.h"
 #include "poolstat_utils.h"

@@ -44,12 +45,10 @@
 
 #ifndef TEXT_DOMAIN
 #define TEXT_DOMAIN     "SYS_TEST"
 #endif
 
-/* calculate offset of a particular element in a structure      */
-#define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
 #define addrof(s)  ((char **)&(s))
 
 /* verify if a field is printable in respect of the current option flags */
 #define PRINTABLE(i)    ((lf->plf_ffs[(i)].pff_prt & D_FIELD) || \
         (lf->plf_ffs[(i)].pff_prt & X_FIELD))