From b2a0fa7e074e29ae4cd8aff04c7b338987d5eed9 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 12 Jun 2016 11:45:45 +0000 Subject: [PATCH] MFC r300967: 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 git-svn-id: svn://svn.freebsd.org/base/stable/10@301839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- 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 1729c7b4b..0b3ed26c2 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -273,7 +273,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. -- 2.45.0