summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorskd <skd@NetBSD.org>2006-08-21 14:09:43 +0000
committerskd <skd@NetBSD.org>2006-08-21 14:09:43 +0000
commit21f8ec95d5f924fa2db4fc4a059e58b5cbae715a (patch)
treee0e0375761067ae5e37e65b585e420c9930f7d67 /include
parentf1fff5b02efcc389f710ceb294da4dd11944b92c (diff)
Use gcc's builtin function. This permits c++ compiliation of const
expressions using offsetof. Boost-python relies on this, for example.
Diffstat (limited to 'include')
-rw-r--r--include/stddef.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stddef.h b/include/stddef.h
index 253b9408bdc..8a4591da0d2 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -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_ */