]> sourceware.org Git - newlib-cygwin.git/commitdiff
Stop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling for C++.
authordim <dim@FreeBSD.org>
Tue, 4 Apr 2017 07:04:53 +0000 (09:04 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 4 Apr 2017 09:43:49 +0000 (11:43 +0200)
It clashes with the one in libc++'s <atomic> header.

(Previously, the _Atomic() macro was defined in <stdatomic.h>, which is
only for use with C11, but for various reasons it was moved to its
current location in r251804.)

Discussed with: bdrewery, ed
MFC after: 2 weeks

newlib/libc/include/sys/cdefs.h

index 1e3c6b0435db87ad3d9919c319f43283477f1b86..0c8fced2789da4bcb8127c95b48e90fde491b971 100644 (file)
 #define        _Alignof(x)             __alignof(x)
 #endif
 
-#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic)
+#if !defined(__cplusplus) && !__has_extension(c_atomic) && \
+    !__has_extension(cxx_atomic)
 /*
  * No native support for _Atomic(). Place object in structure to prevent
  * most forms of direct non-atomic access.
This page took 0.033848 seconds and 5 git commands to generate.