diff options
author | Louis Dionne <ldionne@apple.com> | 2019-08-14 17:01:08 +0000 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2019-08-14 17:01:08 +0000 |
commit | 3555af7120b9bbab05c335546a996950cedc286c (patch) | |
tree | 15e353b96330705e7b5ec80e9e9ef431faa985e0 /libcxx/include | |
parent | c0a9b1edca4192acc6128e92cdd17a5553118745 (diff) | |
download | bcm5719-llvm-3555af7120b9bbab05c335546a996950cedc286c.tar.gz bcm5719-llvm-3555af7120b9bbab05c335546a996950cedc286c.zip |
[libc++] Do not define _LIBCPP_CLANG_VER for non-LLVM Clang
In r292833, we started defining _LIBCPP_CLANG_VER to 0 for Apple Clang.
The result is that AppleClang is detected as being a very old version
of LLVM Clang (version 0), which is obviously incorrect.
I believe this was added so that we don't have to check whether
_LIBCPP_CLANG_VER is defined prior to comparing it with a number
(which can trigger a warning). This commit also fixes the two
places that use the macro correspondingly.
llvm-svn: 368880
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/__config | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index e49adb4d63a..f1b73907023 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -183,10 +183,6 @@ # define _LIBCPP_COMPILER_IBM #endif -#ifndef _LIBCPP_CLANG_VER -#define _LIBCPP_CLANG_VER 0 -#endif - #if defined(_LIBCPP_COMPILER_GCC) && __cplusplus < 201103L #error "libc++ does not support using GCC with C++03. Please enable C++11" #endif @@ -484,7 +480,7 @@ typedef __char32_t char32_t; #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) // No apple compilers support ""d and ""y at this time. -#if _LIBCPP_CLANG_VER < 800 || defined(__apple_build_version__) +#if (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 800) || defined(__apple_build_version__) #define _LIBCPP_HAS_NO_CXX20_CHRONO_LITERALS #endif @@ -1242,7 +1238,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( #ifndef _LIBCPP_NODEBUG_TYPE #if __has_attribute(__nodebug__) && \ - (defined(_LIBCPP_COMPILER_CLANG) && _LIBCPP_CLANG_VER >= 900) + (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 900) #define _LIBCPP_NODEBUG_TYPE __attribute__((nodebug)) #else #define _LIBCPP_NODEBUG_TYPE |