mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Always use compiler builtin for offsetof()
We have received multiple reports of GCC breaking builds when compiler flags like `-std=c11` were being passed. The workaround until the next release is to simply not define `__STRICT_ANSI__` which is a bad idea.
This commit is contained in:
parent
e36283f1d9
commit
06ace4e7b4
2 changed files with 1 additions and 6 deletions
|
@ -473,12 +473,7 @@ typedef struct {
|
|||
#define autotype(x) typeof(x)
|
||||
#endif
|
||||
|
||||
#if defined(__STRICT_ANSI__) || \
|
||||
(!defined(__GNUC__) && !defined(__builtin_offsetof))
|
||||
#define offsetof(type, member) ((unsigned long)&((type *)0)->member)
|
||||
#else
|
||||
#define offsetof(type, member) __builtin_offsetof(type, member)
|
||||
#endif
|
||||
|
||||
#ifdef _COSMO_SOURCE
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue