use __builtin_offsetof for gcc4 and superior, it avoids a gcc4 broken build with template use of offsetof()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20669 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2007-04-12 18:36:37 +00:00
parent b342ed59fb
commit 72b4b94081

View File

@ -5,7 +5,11 @@
*/
#include <null.h>
#if defined(__GNUC__) && __GNUC__ > 3
#define offsetof(type,member) __builtin_offsetof(type, member)
#else
#define offsetof(type,member) ((size_t)&((type*)0)->member)
#endif
typedef long ptrdiff_t;