Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53057 - in trunk: boost/config/stdlib libs/config/test
From: bdawes_at_[hidden]
Date: 2009-05-16 14:41:33


Author: bemandawes
Date: 2009-05-16 14:41:33 EDT (Sat, 16 May 2009)
New Revision: 53057
URL: http://svn.boost.org/trac/boost/changeset/53057

Log:
Refine glibc++ feature tests based on feedback from Jonathan Wakely
Text files modified:
   trunk/boost/config/stdlib/libstdcpp3.hpp | 20 ++++++++++++++++----
   trunk/libs/config/test/config_info.cpp | 1 +
   2 files changed, 17 insertions(+), 4 deletions(-)

Modified: trunk/boost/config/stdlib/libstdcpp3.hpp
==============================================================================
--- trunk/boost/config/stdlib/libstdcpp3.hpp (original)
+++ trunk/boost/config/stdlib/libstdcpp3.hpp 2009-05-16 14:41:33 EDT (Sat, 16 May 2009)
@@ -77,9 +77,21 @@
 # endif
 #endif
 
-// C++0x headers in 20090124 (GCC 4.3.2) and later
+// stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
+// __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
+// developers. He also commented:
 //
-#if !defined(__GLIBCXX__) || __GLIBCXX__<20090124 || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+// "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
+// GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
+// Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
+// than any release in the 4.2 series."
+//
+// Another resource for understanding stdlibc++ features is:
+// http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
+
+// C++0x headers in GCC 4.3.0 and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 # define BOOST_NO_0X_HDR_ARRAY
 # define BOOST_NO_0X_HDR_RANDOM
 # define BOOST_NO_0X_HDR_REGEX
@@ -90,9 +102,9 @@
 # define BOOST_NO_0X_HDR_UNORDERED_SET
 #endif
 
-// C++0x headers in 20090421 (GCC 4.4.0) and later
+// C++0x headers in GCC 4.4.0 and later
 //
-#if !defined(__GLIBCXX__) || __GLIBCXX__<20090421 || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 # define BOOST_NO_0X_HDR_CHRONO
 # define BOOST_NO_0X_HDR_CONDITION_VARIABLE
 # define BOOST_NO_0X_HDR_FORWARD_LIST

Modified: trunk/libs/config/test/config_info.cpp
==============================================================================
--- trunk/libs/config/test/config_info.cpp (original)
+++ trunk/libs/config/test/config_info.cpp 2009-05-16 14:41:33 EDT (Sat, 16 May 2009)
@@ -154,6 +154,7 @@
   // GNUC options:
   PRINT_MACRO(__GNUC__);
   PRINT_MACRO(__GNUC_MINOR__);
+ PRINT_MACRO(__GNUC_PATCHLEVEL__);
   PRINT_MACRO(__STDC_VERSION__);
   PRINT_MACRO(__GNUG__);
   PRINT_MACRO(__STRICT_ANSI__);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk