Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2016-03-24 00:14:00 +0300
committerYaakov Selkowitz <yselkowi@redhat.com>2016-03-24 00:14:00 +0300
commitb9bbe1bccb1254ce891fc92961be2ec3cd3f6e4a (patch)
treec9c5ff440d664be40b15e57416805320aa3dd22a /newlib/libc
parentb59866f806b1afd2f006012850b13cebbcafafd4 (diff)
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>
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/include/sys/features.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index 1625495f4..86297de43 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