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.
llvm-svn: 155091
diff --git a/libcxx/src/stdexcept.cpp b/libcxx/src/stdexcept.cpp
index b516b0c..9fa4f59 100644
--- a/libcxx/src/stdexcept.cpp
+++ b/libcxx/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