Print this page
3373 gcc >= 4.5 concerns about offsetof()
*** 25,36 ****
*/
#ifndef _SYS_ECPPVAR_H
#define _SYS_ECPPVAR_H
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/note.h>
#ifdef __cplusplus
extern "C" {
#endif
--- 25,34 ----
*** 511,521 ****
--- 509,523 ----
/*
* Other useful macros
*/
#define NELEM(a) (sizeof (a) / sizeof (*(a)))
+ #if defined(__GNUC__)
+ #define offsetof(s, m) __builtin_offsetof(s, m)
+ #else
#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
+ #endif
#ifdef __cplusplus
}
#endif