aboutsummaryrefslogtreecommitdiff
path: root/gcc/ginclude
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2022-09-12 14:34:26 +0000
committerJoseph Myers <joseph@codesourcery.com>2022-09-12 14:34:58 +0000
commit2e7bc76d84f0aa2f08bc01407ffcdca43c15f2ff (patch)
treebe3d4aa535967fbe15d9398255529274b0c48a81 /gcc/ginclude
parent6b43f556f392a7165582aca36a19fe7389d995b2 (diff)
downloadgcc-2e7bc76d84f0aa2f08bc01407ffcdca43c15f2ff.zip
gcc-2e7bc76d84f0aa2f08bc01407ffcdca43c15f2ff.tar.gz
gcc-2e7bc76d84f0aa2f08bc01407ffcdca43c15f2ff.tar.bz2
stdatomic.h: Do not define ATOMIC_VAR_INIT for C2x
The <stdatomic.h> macro ATOMIC_VAR_INIT, previously declared obsolete, is removed completely in C2x; disable it for C2x in GCC's implementation. (Although ATOMIC_* are reserved names for this header, disabling the macro for C2x still seems appropriate.) Bootstrapped with no regressions for x86_64-pc-linux-gnu. gcc/ * ginclude/stdatomic.h [defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L] (ATOMIC_VAR_INIT): Do not define. gcc/testsuite/ * gcc.dg/atomic/c2x-stdatomic-var-init-1.c: New test.
Diffstat (limited to 'gcc/ginclude')
-rw-r--r--gcc/ginclude/stdatomic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ginclude/stdatomic.h b/gcc/ginclude/stdatomic.h
index 9f2475b..a56ba5d 100644
--- a/gcc/ginclude/stdatomic.h
+++ b/gcc/ginclude/stdatomic.h
@@ -79,7 +79,9 @@ typedef _Atomic __INTMAX_TYPE__ atomic_intmax_t;
typedef _Atomic __UINTMAX_TYPE__ atomic_uintmax_t;
+#if !(defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L)
#define ATOMIC_VAR_INIT(VALUE) (VALUE)
+#endif
/* Initialize an atomic object pointed to by PTR with VAL. */
#define atomic_init(PTR, VAL) \