diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-10-03 20:48:05 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-10-03 20:48:05 +0000 |
commit | f543a75be1f4c6d01445b90d37dd4e4185872df5 (patch) | |
tree | bc4fd3bccc76a8725a2fc18af000de59c1d7f12b /libcxx | |
parent | bfdde7cb603220b008632e21e9e11af22a8cc636 (diff) | |
download | bcm5719-llvm-f543a75be1f4c6d01445b90d37dd4e4185872df5.tar.gz bcm5719-llvm-f543a75be1f4c6d01445b90d37dd4e4185872df5.zip |
Holger Arnold: Correct the use and testing of __GNUC__ and __GNUC_MINOR__ in <__config>.
llvm-svn: 165151
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/CREDITS.TXT | 4 | ||||
-rw-r--r-- | libcxx/include/__config | 17 |
2 files changed, 15 insertions, 6 deletions
diff --git a/libcxx/CREDITS.TXT b/libcxx/CREDITS.TXT index ba683152639..336edde9b18 100644 --- a/libcxx/CREDITS.TXT +++ b/libcxx/CREDITS.TXT @@ -66,3 +66,7 @@ D: Minor patches to is_convertible. N: Dimitry Andric E: dimitry@andric.com D: Visibility fixes, minor FreeBSD portability patches. + +N: Holger Arnold +E: holgerar@gmail.com +D: Minor fix. diff --git a/libcxx/include/__config b/libcxx/include/__config index f2b53a81116..189140f07d8 100644 --- a/libcxx/include/__config +++ b/libcxx/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 |