mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
* Source/NSObject.m (__builtin_offsetof): Add workaround for build in missing
in old versions of gcc. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33774 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
80c8a7ff06
commit
8da720fc7a
2 changed files with 8 additions and 0 deletions
|
@ -401,6 +401,9 @@ static inline NSLock *GSAllocationLockForObject(id p)
|
|||
#ifdef ALIGN
|
||||
#undef ALIGN
|
||||
#endif
|
||||
#if defined(__GNUC__) && __GNUC__ < 4
|
||||
#define __builtin_offsetof(s, f) (uintptr_t)(&(((s*)0)->f))
|
||||
#endif
|
||||
#define alignof(type) __builtin_offsetof(struct { const char c; type member; }, member)
|
||||
#define ALIGN alignof(double)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue