diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-07-26 17:42:39 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-07-26 17:42:39 +0000 |
commit | 8b5bb3c5af878dbcbb548bac3579e46ad10189be (patch) | |
tree | 1241a0176c6b840fe2f38e822fb143743a3bfecf /src/typeinfo.cpp | |
parent | ca8eb830dd5d767d86f6244862c8e1bab3ae6618 (diff) | |
download | libcxx-8b5bb3c5af878dbcbb548bac3579e46ad10189be.tar.gz |
Patch by Andrew C. Morrow: Conditionally include cxxabi.h in new.cpp and typeinfo.cpp. Both new.cpp and typeinfo.cpp have code that is conditionally compiled
based on the LIBCXXRT and _LIBCPPABI_VERSION defines, but those files
do not currently include <cxxabi.h> in the non __APPLE__ case. The
attached patch updates those files so that for non __APPLE__ builds
<cxxabi.h> is included if available or if LIBCXXRT is set. I'm
modeling this on the recent updates to exception.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@160790 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/typeinfo.cpp')
-rw-r--r-- | src/typeinfo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/typeinfo.cpp b/src/typeinfo.cpp index cfc64ef57..6bab0771f 100644 --- a/src/typeinfo.cpp +++ b/src/typeinfo.cpp @@ -7,8 +7,15 @@ // //===----------------------------------------------------------------------===// #include <stdlib.h> + +#ifndef __has_include +#define __has_include(inc) 0 +#endif + #if __APPLE__ #include <cxxabi.h> +#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>) +#include <cxxabi.h> #endif #include "typeinfo" |