diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-16 11:14:30 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-16 11:14:30 +0000 |
commit | 929df471a94c92ab744c5af7a33de5a0ad6699d2 (patch) | |
tree | d6533816fbd27b3ca5af1f68ef6d160d119c64d2 /libcxx/src | |
parent | 2fa025cdcf35b2c92fda7f1d47bfc33102bea0ac (diff) | |
download | llvm-929df471a94c92ab744c5af7a33de5a0ad6699d2.zip llvm-929df471a94c92ab744c5af7a33de5a0ad6699d2.tar.gz llvm-929df471a94c92ab744c5af7a33de5a0ad6699d2.tar.bz2 |
Remove a long-standing __has_include hack.
This was put in to get libc++ building without libcxxabi. We now have
macros that show that we are building against libcxxabi so use that
instead. This guards against existing but broken cxxabi.h headers on the
system.
llvm-svn: 250507
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/exception.cpp | 10 | ||||
-rw-r--r-- | libcxx/src/new.cpp | 8 | ||||
-rw-r--r-- | libcxx/src/stdexcept.cpp | 6 | ||||
-rw-r--r-- | libcxx/src/typeinfo.cpp | 9 |
4 files changed, 8 insertions, 25 deletions
diff --git a/libcxx/src/exception.cpp b/libcxx/src/exception.cpp index 2c16060..e172f64 100644 --- a/libcxx/src/exception.cpp +++ b/libcxx/src/exception.cpp @@ -12,10 +12,6 @@ #include "exception" #include "new" -#ifndef __has_include -#define __has_include(inc) 0 -#endif - #if defined(__APPLE__) && !defined(LIBCXXRT) #include <cxxabi.h> @@ -29,16 +25,16 @@ #define __terminate_handler __cxxabiapple::__cxa_terminate_handler #define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler #endif // _LIBCPPABI_VERSION -#elif defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) || __has_include(<cxxabi.h>) +#elif defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) #include <cxxabi.h> using namespace __cxxabiv1; #if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION) #define HAVE_DEPENDENT_EH_ABI 1 #endif -#elif !defined(__GLIBCXX__) // __has_include(<cxxabi.h>) +#elif !defined(__GLIBCXX__) // defined(LIBCXX_BUILDING_LIBCXXABI) static std::terminate_handler __terminate_handler; static std::unexpected_handler __unexpected_handler; -#endif // __has_include(<cxxabi.h>) +#endif // defined(LIBCXX_BUILDING_LIBCXXABI) namespace std { diff --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp index 1144651..f4f73d8 100644 --- a/libcxx/src/new.cpp +++ b/libcxx/src/new.cpp @@ -13,10 +13,6 @@ #include "new" -#ifndef __has_include -#define __has_include(inc) 0 -#endif - #if defined(__APPLE__) && !defined(LIBCXXRT) #include <cxxabi.h> @@ -27,9 +23,9 @@ #define __new_handler __cxxabiapple::__cxa_new_handler #endif #else // __APPLE__ - #if defined(LIBCXXRT) || __has_include(<cxxabi.h>) + #if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) #include <cxxabi.h> - #endif // __has_include(<cxxabi.h>) + #endif // defined(LIBCXX_BUILDING_LIBCXXABI) #if !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__) static std::new_handler __new_handler; #endif // _LIBCPPABI_VERSION diff --git a/libcxx/src/stdexcept.cpp b/libcxx/src/stdexcept.cpp index aff4b18..577376e 100644 --- a/libcxx/src/stdexcept.cpp +++ b/libcxx/src/stdexcept.cpp @@ -13,12 +13,8 @@ #include "string" #include "system_error" -#ifndef __has_include -#define __has_include(inc) 0 -#endif - /* For _LIBCPPABI_VERSION */ -#if __has_include(<cxxabi.h>) || defined(__APPLE_) || defined(LIBCXXRT) +#if defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE_) || defined(LIBCXXRT) #include <cxxabi.h> #endif diff --git a/libcxx/src/typeinfo.cpp b/libcxx/src/typeinfo.cpp index b428120..5c0a609 100644 --- a/libcxx/src/typeinfo.cpp +++ b/libcxx/src/typeinfo.cpp @@ -8,13 +8,8 @@ //===----------------------------------------------------------------------===// #include <stdlib.h> -#ifndef __has_include -#define __has_include(inc) 0 -#endif - -#ifdef __APPLE__ -#include <cxxabi.h> -#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>) +#if defined(__APPLE__) || defined(LIBCXXRT) || \ + defined(LIBCXX_BUILDING_LIBCXXABI) #include <cxxabi.h> #endif |