summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-10-03 20:48:05 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-10-03 20:48:05 +0000
commit75536baae747cc5e2202285e416ef037a70cd156 (patch)
treed558eb738035b91899655a11cb899887dda98f85 /include
parent95c0e9f9e1cdc9d9cf2192530074583f788a7909 (diff)
downloadexternal_libcxx-75536baae747cc5e2202285e416ef037a70cd156.tar.gz
external_libcxx-75536baae747cc5e2202285e416ef037a70cd156.tar.bz2
external_libcxx-75536baae747cc5e2202285e416ef037a70cd156.zip
Holger Arnold: Correct the use and testing of __GNUC__ and __GNUC_MINOR__ in <__config>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@165151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/__config17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/__config b/include/__config
index f2b53a811..189140f07 100644
--- a/include/__config
+++ b/include/__config
@@ -15,6 +15,10 @@
#pragma GCC system_header
#endif
+#ifdef __GNUC__
+#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
+#endif
+
#define _LIBCPP_VERSION 1101
#define _LIBCPP_ABI_VERSION 1
@@ -53,7 +57,8 @@
# define _LIBCPP_LITTLE_ENDIAN 1
# define _LIBCPP_BIG_ENDIAN 0
// Compiler intrinsics (GCC or MSVC)
-# if (defined(_MSC_VER) && _MSC_VER >= 1400) || (__GNUC__ >= 4 && __GNUC_MINOR__ > 3)
+# if (defined(_MSC_VER) && _MSC_VER >= 1400) \
+ || (defined(__GNUC__) && _GNUC_VER > 403)
# define _LIBCP_HAS_IS_BASE_OF
# endif
#endif // _WIN32
@@ -308,15 +313,15 @@ namespace std {
#define _LIBCPP_HAS_NO_TRAILING_RETURN
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
-#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
+#if _GNUC_VER < 403
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
-#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
+#if _GNUC_VER < 403
#define _LIBCPP_HAS_NO_STATIC_ASSERT
#endif
-#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
+#if _GNUC_VER < 404
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_DECLTYPE
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
@@ -324,9 +329,9 @@ namespace std {
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
+#endif // _GNUC_VER < 404
-#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6)
+#if _GNUC_VER < 406
#define _LIBCPP_HAS_NO_NULLPTR
#endif