summaryrefslogtreecommitdiffstats
path: root/libcxx/include/new
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2017-10-09 19:25:17 +0000
committerShoaib Meenai <smeenai@fb.com>2017-10-09 19:25:17 +0000
commit492d7134f3bdd76415d8e7b20a4f1c9a42b85e44 (patch)
tree27a915541601915c1d3750813fb945ad776f5f6c /libcxx/include/new
parent6ab4d075ff40675af20ffc4124d1dc03609518fe (diff)
downloadbcm5719-llvm-492d7134f3bdd76415d8e7b20a4f1c9a42b85e44.tar.gz
bcm5719-llvm-492d7134f3bdd76415d8e7b20a4f1c9a42b85e44.zip
[libc++] Support Microsoft ABI without vcruntime headers
The vcruntime headers are hairy and clash with both libc++ headers themselves and other libraries. libc++ normally deals with the clashes by deferring to the vcruntime headers and silencing its own definitions, but for clients which don't want to depend on vcruntime headers, it's desirable to support the opposite, i.e. have libc++ provide its own definitions. Certain operator new/delete replacement scenarios are not currently supported in this mode, which requires some tests to be marked XFAIL. The added documentation has more details. Differential Revision: https://reviews.llvm.org/D38522 llvm-svn: 315234
Diffstat (limited to 'libcxx/include/new')
-rw-r--r--libcxx/include/new10
1 files changed, 5 insertions, 5 deletions
diff --git a/libcxx/include/new b/libcxx/include/new
index 34df2efee09..06cf4a3e160 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -92,7 +92,7 @@ void operator delete[](void* ptr, void*) noexcept;
#include <cstdlib>
#endif
-#if defined(_LIBCPP_ABI_MICROSOFT)
+#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
#include <new.h>
#endif
@@ -114,7 +114,7 @@ void operator delete[](void* ptr, void*) noexcept;
namespace std // purposefully not using versioning namespace
{
-#if !defined(_LIBCPP_ABI_MICROSOFT)
+#if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME)
struct _LIBCPP_TYPE_VIS nothrow_t {};
extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
@@ -140,7 +140,7 @@ typedef void (*new_handler)();
_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
-#endif // !_LIBCPP_ABI_MICROSOFT
+#endif // !_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
@@ -174,7 +174,7 @@ enum align_val_t { __zero = 0, __max = (size_t)-1 };
#define _THROW_BAD_ALLOC
#endif
-#if !defined(_LIBCPP_ABI_MICROSOFT)
+#if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME)
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
@@ -215,7 +215,7 @@ inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _N
inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {}
inline _LIBCPP_INLINE_VISIBILITY void operator delete[](void*, void*) _NOEXCEPT {}
-#endif // !_LIBCPP_ABI_MICROSOFT
+#endif // !_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME
_LIBCPP_BEGIN_NAMESPACE_STD
OpenPOWER on IntegriCloud