diff --git a/config.htm b/config.htm index 75f58f60..fa9290ac 100644 --- a/config.htm +++ b/config.htm @@ -19,6 +19,7 @@ Boost Macro Reference Macros that describe defects Macros that describe optional features + Macros that describe C++0x features Boost Helper Macros Boost Informational Macros Macros for libraries with separate source code @@ -869,17 +870,17 @@ void g() { return f(); } hash_set and hash_map; BOOST_STD_EXTENSION_NAMESPACE will provide the namespace in which the two class templates reside. +
The following macros describe features that are likely to be + included in the upcoming ISO C++ standard, C++0x.
+ +Macro + |
+ Description + |
+
BOOST_CXX0X_CONCEPTS | ++ The compiler supports concepts. Note: concepts have been + proposed for C++0x, but have not yet been approved for + inclusion in the language. + | +
BOOST_CXX0X_LONG_LONG | ++ The compiler supports the long long. Identical to BOOST_HAS_LONG_LONG. + | +
BOOST_CXX0X_PREPROCESSOR | +
+ The compiler supports the C99
+ preprocessor, which includes variadic macros,
+ concatenation of wide string literals, and the
+ _Pragma operator.
+ |
+
BOOST_CXX0X_RVALUE_REFERENCES | ++ The compiler supports rvalue + references. + | +
BOOST_CXX0X_STATIC_ASSERT | ++ The compiler supports static assertions. + | +
BOOST_CXX0X_VARIADIC_TEMPLATES | ++ The compiler supports variadic + templates. Note: variadic templates have been + proposed for C++0x, but have not yet been approved for + inclusion in the language. + | +
The following macros are either simple helpers, or macros that provide workarounds for compiler/standard library defects.
diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index d94b16b7..f8cb1885 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -82,7 +82,41 @@ #define BOOST_HAS_NRVO #endif -#define BOOST_COMPILER "GNU C++ version " __VERSION__ +// +// C++0x features +// +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2) +// C++0x features are only enabled when -std=c++0x or -std=gnu++0x are +// passed on the command line, which in turn defines +// __GXX_EXPERIMENTAL_CXX0X__. Note: __GXX_EXPERIMENTAL_CPP0X__ is +// defined by some very early development versions of GCC 4.3; we will +// remove this part of the check in the near future. +# if defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define BOOST_CXX0X_PREPROCESSOR +# define BOOST_CXX0X_STATIC_ASSERT +# endif +#endif + +// +// Potential C++0x features +// + +// Variadic templates compiler: +// http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html +#ifdef __VARIADIC_TEMPLATES +# define BOOST_CXX0X_VARIADIC_TEMPLATES +#endif + +// ConceptGCC compiler: +// http://www.generic-programming.org/software/ConceptGCC/ +#ifdef __GXX_CONCEPTS__ +# define BOOST_CXX0X_CONCEPTS +# define "ConceptGCC version " __VERSION__ +#endif + +#ifndef BOOST_COMPILER +# define BOOST_COMPILER "GNU C++ version " __VERSION__ +#endif // // versions check: @@ -91,8 +125,8 @@ # error "Compiler not configured - please reconfigure" #endif // -// last known and checked version is 4.0 (Pre-release): -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)) +// last known and checked version is 4.3 (Pre-release): +#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 3)) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index 61a8d46a..556fd312 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -38,6 +38,16 @@ # endif #endif +// BOOST_HAS_LONG_LONG implies BOOST_CXX0X_LONG_LONG, and vice-versa +#if defined(BOOST_HAS_LONG_LONG) || defined(BOOST_CXX0X_LONG_LONG) +# ifndef BOOST_HAS_LONG_LONG +# define BOOST_HAS_LONG_LONG +# endif +# ifndef BOOST_CXX0X_LONG_LONG +# define BOOST_CXX0X_LONG_LONG +# endif +#endif + // GCC 3.x will clean up all of those nasty macro definitions that // BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine // it under GCC 3.x.