From e0dabc0e8dd6d9e2a21ceef124a1e4bf9f3d8aa3 Mon Sep 17 00:00:00 2001 From: dim Date: Tue, 4 Apr 2017 09:04:53 +0200 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 --- newlib/libc/include/sys/cdefs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index 1e3c6b043..0c8fced27 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -295,7 +295,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.