diff --git a/libcxx/include/new b/libcxx/include/new --- a/libcxx/include/new +++ b/libcxx/include/new @@ -146,10 +146,6 @@ const char* what() const _NOEXCEPT override; }; -typedef void (*new_handler)(); -_LIBCPP_EXPORTED_FROM_ABI new_handler set_new_handler(new_handler) _NOEXCEPT; -_LIBCPP_EXPORTED_FROM_ABI new_handler get_new_handler() _NOEXCEPT; - #elif defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0 // !_LIBCPP_ABI_VCRUNTIME // When _HAS_EXCEPTIONS == 0, these complete definitions are needed, @@ -170,6 +166,10 @@ }; #endif // defined(_LIBCPP_ABI_VCRUNTIME) && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0 +typedef void (*new_handler)(); +_LIBCPP_EXPORTED_FROM_ABI new_handler set_new_handler(new_handler) _NOEXCEPT; +_LIBCPP_EXPORTED_FROM_ABI new_handler get_new_handler() _NOEXCEPT; + _LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_bad_alloc(); // not in C++ spec _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/src/new_handler.cpp b/libcxx/src/new_handler.cpp --- a/libcxx/src/new_handler.cpp +++ b/libcxx/src/new_handler.cpp @@ -11,9 +11,7 @@ #include "include/atomic_support.h" #if defined(_LIBCPP_ABI_MICROSOFT) -# if !defined(_LIBCPP_ABI_VCRUNTIME) -# define _LIBPCPP_DEFINE_NEW_HANDLER -# endif +# define _LIBPCPP_DEFINE_NEW_HANDLER #elif defined(LIBCXX_BUILDING_LIBCXXABI) // nothing to do, we use the one from libc++abi #elif defined(LIBCXXRT)