This is the mail archive of the
newlib-cvs@sourceware.org
mailing list for the newlib project.
[newlib-cygwin] Feature test macros overhaul: C++ TR1
- From: Yaakov Selkowitz <yselkowitz at sourceware dot org>
- To: newlib-cvs at sourceware dot org
- Date: 23 Mar 2016 21:30:17 -0000
- Subject: [newlib-cygwin] Feature test macros overhaul: C++ TR1
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b9bbe1bccb1254ce891fc92961be2ec3cd3f6e4a
commit b9bbe1bccb1254ce891fc92961be2ec3cd3f6e4a
Author: Yaakov Selkowitz <yselkowi@redhat.com>
Date: Wed Mar 23 16:14:00 2016 -0500
Feature test macros overhaul: C++ TR1
While C++11 was the first version of the standard to use C99 functionality,
TR1 (for C++03) also does, and G++ does not distinguish between C++98 and
C++03, or when TR1 is in use. Therefore, while not strictly correct for
"pure" C++98, enabling C99 for all C++ usage is the simplest solution (and
much better than always using -D_GNU_SOURCE as on Linux).
See thread starting: https://sourceware.org/ml/newlib/2016/msg00297.html
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diff:
---
newlib/libc/include/sys/features.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index 1625495..86297de 100644
--- a/newlib/libc/include/sys/features.h
+++ b/newlib/libc/include/sys/features.h
@@ -81,7 +81,7 @@ extern "C" {
* _XOPEN_SOURCE >= 700
* SUSv4 (POSIX.1-2008 plus XSI)
*
- * _ISOC99_SOURCE or gcc -std=c99 or g++ -std=c++11
+ * _ISOC99_SOURCE or gcc -std=c99 or g++
* ISO C99
*
* _ISOC11_SOURCE or gcc -std=c11 or g++ -std=c++11
@@ -204,8 +204,8 @@ extern "C" {
*
* __ISO_C_VISIBLE >= 1999
* ISO C99; enabled with gcc -std=c99 or newer (on by default since GCC 5),
- * g++ -std=c++11 or newer (on by default since GCC 6), or with
- * _ISOC99_SOURCE, _POSIX_C_SOURCE >= 200112L, or _XOPEN_SOURCE >= 600.
+ * any version of C++, or with _ISOC99_SOURCE, _POSIX_C_SOURCE >= 200112L,
+ * or _XOPEN_SOURCE >= 600.
*
* __ISO_C_VISIBLE >= 2011
* ISO C11; enabled with gcc -std=c11 or newer (on by default since GCC 5),
@@ -259,8 +259,8 @@ extern "C" {
#if defined(_ISOC11_SOURCE) || \
(__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
#define __ISO_C_VISIBLE 2011
-#elif defined(_ISOC99_SOURCE) || \
- (__STDC_VERSION__ - 0) >= 199901L || (_POSIX_C_SOURCE - 0) >= 200112L
+#elif defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) >= 200112L || \
+ (__STDC_VERSION__ - 0) >= 199901L || defined(__cplusplus)
#define __ISO_C_VISIBLE 1999
#else
#define __ISO_C_VISIBLE 1990