aboutsummaryrefslogtreecommitdiff
path: root/gcc/ginclude
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2022-01-28 16:34:50 +0000
committerOlivier Hainque <hainque@adacore.com>2022-10-07 06:51:53 +0000
commit8307b7d6d0335da952a87bf56015f830072ac431 (patch)
tree80bfb2fcae89cc3c87093de9c6d9b0972c1b5705 /gcc/ginclude
parent8a9e92b249c9c5a5371588b1e939a90a677b4fd3 (diff)
downloadgcc-8307b7d6d0335da952a87bf56015f830072ac431.zip
gcc-8307b7d6d0335da952a87bf56015f830072ac431.tar.gz
gcc-8307b7d6d0335da952a87bf56015f830072ac431.tar.bz2
undef offsetof before defining it in stddef.h
This prevents redefinition warnings by -Wsystem-headers on OSses where system headers happen to provide a definition of their own, such as VxWorks. 2022-02-15 Olivier Hainque <hainque@adacore.com> gcc/ * ginclude/stddef.h: #undef offsetof before #define.
Diffstat (limited to 'gcc/ginclude')
-rw-r--r--gcc/ginclude/stddef.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
index 3d29213..2767edf 100644
--- a/gcc/ginclude/stddef.h
+++ b/gcc/ginclude/stddef.h
@@ -412,6 +412,7 @@ typedef __WINT_TYPE__ wint_t;
#ifdef _STDDEF_H
/* Offset of member MEMBER in a struct of type TYPE. */
+#undef offsetof /* in case a system header has defined it. */
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \