libc++: only #include <cxxabi.h> if it exists. This allows libc++ to build
out of the box on Linux systems. If you're building against libc++abi, you
still need to make sure it can find <cxxabi.h> so it knows not to export
symbols which libc++abi provides.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@155091 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/src/stdexcept.cpp b/src/stdexcept.cpp
index b516b0c..9fa4f59 100644
--- a/src/stdexcept.cpp
+++ b/src/stdexcept.cpp
@@ -15,7 +15,11 @@
#include <cstdint>
#include <cstddef>
#include "system_error"
+
+// Use <cxxabi.h> to determine whether we're linking against libc++abi.
+#if __has_include(<cxxabi.h>)
#include <cxxabi.h>
+#endif
// Note: optimize for size