Stop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling for C++.

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
This commit is contained in:
dim 2017-04-04 09:04:53 +02:00 committed by Corinna Vinschen
parent 086730fb14
commit e0dabc0e8d
1 changed files with 2 additions and 1 deletions

View File

@ -295,7 +295,8 @@
#define _Alignof(x) __alignof(x) #define _Alignof(x) __alignof(x)
#endif #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 * No native support for _Atomic(). Place object in structure to prevent
* most forms of direct non-atomic access. * most forms of direct non-atomic access.