sys/_offsetof.h: pacify GCC 12's macro redefinition check

GCC 12 has a strict definition of identity (all characters including
whitespace must be identical) when comparing "redefined" macros. Make
our definition exactly match the stddef.h that comes with GCC to fix
test-includes of netlink/netlink_snl.h.  (Note: later versions of GCC
are a bit more flexible and don't have this problem.)

Reported by:	des
Sponsored by:	DARPA, AFRL
Fixes:		2adc3f0db1 ("stddef.h: centralize definition of offsetof()")
This commit is contained in:
Brooks Davis
2026-02-23 09:45:58 +00:00
parent ab835b3707
commit 0076f6d1ad
+1 -1
View File
@@ -13,7 +13,7 @@
#define _SYS__OFFSETOF_H_
#ifndef offsetof
#define offsetof(type, field) __builtin_offsetof(type, field)
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
#endif
#endif /* _SYS__OFFSETOF_H_ */