public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Stop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling for C++.
@ 2017-04-04  9:44 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-04-04  9:44 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e0dabc0e8dd6d9e2a21ceef124a1e4bf9f3d8aa3

commit e0dabc0e8dd6d9e2a21ceef124a1e4bf9f3d8aa3
Author: dim <dim@FreeBSD.org>
Date:   Tue Apr 4 09:04:53 2017 +0200

    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

Diff:
---
 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 1e3c6b0..0c8fced 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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-04  9:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04  9:44 [newlib-cygwin] Stop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling for C++ Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).