Use gcc's builtin function. This permits c++ compiliation of const
expressions using offsetof. Boost-python relies on this, for example.
This commit is contained in:
parent
f1fff5b02e
commit
21f8ec95d5
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: stddef.h,v 1.10 2003/08/07 09:44:11 agc Exp $ */
|
||||
/* $NetBSD: stddef.h,v 1.11 2006/08/21 14:09:43 skd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
|
@ -50,6 +50,6 @@ typedef _BSD_WCHAR_T_ wchar_t;
|
|||
|
||||
#include <sys/null.h>
|
||||
|
||||
#define offsetof(type, member) ((size_t)(unsigned long)(&((type *)0)->member))
|
||||
#define offsetof(type, member) __builtin_offsetof(type,member)
|
||||
|
||||
#endif /* _STDDEF_H_ */
|
||||
|
|
Loading…
Reference in New Issue