From 4a8240ec661dbf2d0b3fac9c42f8baad33028a8e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 29 May 2016 17:32:19 +0000 Subject: [PATCH] Stop exposing the C11 _Atomic() macro in , when compiling for C++. It clashes with the one in libc++'s header. (Previously, the _Atomic() macro was defined in , 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 --- sys/sys/cdefs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 11c4d1e95c8b..89516cf4a835 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -275,7 +275,8 @@ #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.