forked from OSchip/llvm-project
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. llvm-svn: 160790
This commit is contained in:
parent
a5fc75f4f5
commit
dce0696a36
|
@ -11,6 +11,10 @@
|
||||||
|
|
||||||
#include "new"
|
#include "new"
|
||||||
|
|
||||||
|
#ifndef __has_include
|
||||||
|
#define __has_include(inc) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
|
||||||
|
@ -21,7 +25,12 @@
|
||||||
#define __new_handler __cxxabiapple::__cxa_new_handler
|
#define __new_handler __cxxabiapple::__cxa_new_handler
|
||||||
#endif
|
#endif
|
||||||
#else // __APPLE__
|
#else // __APPLE__
|
||||||
static std::new_handler __new_handler;
|
#if defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
||||||
|
#include <cxxabi.h>
|
||||||
|
#endif // __has_include(<cxxabi.h>)
|
||||||
|
#ifndef _LIBCPPABI_VERSION
|
||||||
|
static std::new_handler __new_handler;
|
||||||
|
#endif // _LIBCPPABI_VERSION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Implement all new and delete operators as weak definitions
|
// Implement all new and delete operators as weak definitions
|
||||||
|
|
|
@ -7,8 +7,15 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifndef __has_include
|
||||||
|
#define __has_include(inc) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
||||||
|
#include <cxxabi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "typeinfo"
|
#include "typeinfo"
|
||||||
|
|
Loading…
Reference in New Issue