Skip to content

Commit 929df47

Browse files
committed
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
1 parent 2fa025c commit 929df47

File tree

4 files changed

+8
-25
lines changed

4 files changed

+8
-25
lines changed

libcxx/src/exception.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
#include "exception"
1313
#include "new"
1414

15-
#ifndef __has_include
16-
#define __has_include(inc) 0
17-
#endif
18-
1915
#if defined(__APPLE__) && !defined(LIBCXXRT)
2016
#include <cxxabi.h>
2117

@@ -29,16 +25,16 @@
2925
#define __terminate_handler __cxxabiapple::__cxa_terminate_handler
3026
#define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler
3127
#endif // _LIBCPPABI_VERSION
32-
#elif defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) || __has_include(<cxxabi.h>)
28+
#elif defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
3329
#include <cxxabi.h>
3430
using namespace __cxxabiv1;
3531
#if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION)
3632
#define HAVE_DEPENDENT_EH_ABI 1
3733
#endif
38-
#elif !defined(__GLIBCXX__) // __has_include(<cxxabi.h>)
34+
#elif !defined(__GLIBCXX__) // defined(LIBCXX_BUILDING_LIBCXXABI)
3935
static std::terminate_handler __terminate_handler;
4036
static std::unexpected_handler __unexpected_handler;
41-
#endif // __has_include(<cxxabi.h>)
37+
#endif // defined(LIBCXX_BUILDING_LIBCXXABI)
4238

4339
namespace std
4440
{

libcxx/src/new.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313

1414
#include "new"
1515

16-
#ifndef __has_include
17-
#define __has_include(inc) 0
18-
#endif
19-
2016
#if defined(__APPLE__) && !defined(LIBCXXRT)
2117
#include <cxxabi.h>
2218

@@ -27,9 +23,9 @@
2723
#define __new_handler __cxxabiapple::__cxa_new_handler
2824
#endif
2925
#else // __APPLE__
30-
#if defined(LIBCXXRT) || __has_include(<cxxabi.h>)
26+
#if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
3127
#include <cxxabi.h>
32-
#endif // __has_include(<cxxabi.h>)
28+
#endif // defined(LIBCXX_BUILDING_LIBCXXABI)
3329
#if !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
3430
static std::new_handler __new_handler;
3531
#endif // _LIBCPPABI_VERSION

libcxx/src/stdexcept.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313
#include "string"
1414
#include "system_error"
1515

16-
#ifndef __has_include
17-
#define __has_include(inc) 0
18-
#endif
19-
2016
/* For _LIBCPPABI_VERSION */
21-
#if __has_include(<cxxabi.h>) || defined(__APPLE_) || defined(LIBCXXRT)
17+
#if defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE_) || defined(LIBCXXRT)
2218
#include <cxxabi.h>
2319
#endif
2420

libcxx/src/typeinfo.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@
88
//===----------------------------------------------------------------------===//
99
#include <stdlib.h>
1010

11-
#ifndef __has_include
12-
#define __has_include(inc) 0
13-
#endif
14-
15-
#ifdef __APPLE__
16-
#include <cxxabi.h>
17-
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
11+
#if defined(__APPLE__) || defined(LIBCXXRT) || \
12+
defined(LIBCXX_BUILDING_LIBCXXABI)
1813
#include <cxxabi.h>
1914
#endif
2015

0 commit comments

Comments
 (0)