diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2018-01-10 18:16:58 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-01-10 18:16:58 +0000 |
| commit | 4566d827a1e9a01df51f9b6539b89d0851e98a00 (patch) | |
| tree | 9ea0eece0205851e8c3c62077244ed143ffbd33d | |
| parent | b42ffa1283ae56a76e6821595db92c0fd7bc8d78 (diff) | |
| download | bcm5719-llvm-4566d827a1e9a01df51f9b6539b89d0851e98a00.tar.gz bcm5719-llvm-4566d827a1e9a01df51f9b6539b89d0851e98a00.zip | |
libcxx: Stop providing a definition of __GLIBC_PREREQ.
An application may determine whether the C standard library is glibc
by testing whether __GLIBC_PREREQ is defined. This breaks if libc++
provides its own definition. Instead, define our own macro in our
namespace with the desired semantics.
Differential Revision: https://reviews.llvm.org/D41892
llvm-svn: 322201
| -rw-r--r-- | libcxx/include/__config | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index 06f8b390bb9..94832ff40e1 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -184,9 +184,11 @@ // Need to detect which libc we're using if we're on Linux. #if defined(__linux__) #include <features.h> -#if !defined(__GLIBC_PREREQ) -#define __GLIBC_PREREQ(a, b) 0 -#endif // !defined(__GLIBC_PREREQ) +#if defined(__GLIBC_PREREQ) +#define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b) +#else +#define _LIBCPP_GLIBC_PREREQ(a, b) 0 +#endif // defined(__GLIBC_PREREQ) #endif // defined(__linux__) #ifdef __LITTLE_ENDIAN__ @@ -416,10 +418,10 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_C11_FEATURES #elif defined(__linux__) #if !defined(_LIBCPP_HAS_MUSL_LIBC) -#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) +#if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__) #define _LIBCPP_HAS_QUICK_EXIT #endif -#if __GLIBC_PREREQ(2, 17) +#if _LIBCPP_GLIBC_PREREQ(2, 17) #define _LIBCPP_HAS_C11_FEATURES #endif #else // defined(_LIBCPP_HAS_MUSL_LIBC) |

