File tree Expand file tree Collapse file tree 4 files changed +25
-21
lines changed Expand file tree Collapse file tree 4 files changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ set(LIBCXX_SOURCES
35
35
mutex.cpp
36
36
mutex_destructor.cpp
37
37
new.cpp
38
+ new_handler.cpp
38
39
optional .cpp
39
40
random_shuffle.cpp
40
41
ryu/d2fixed.cpp
@@ -52,7 +53,6 @@ set(LIBCXX_SOURCES
52
53
support/runtime/exception_pointer_glibcxx.ipp
53
54
support/runtime/exception_pointer_msvc.ipp
54
55
support/runtime/exception_pointer_unimplemented.ipp
55
- support/runtime/new_handler_fallback.ipp
56
56
support/runtime/stdexcept_default.ipp
57
57
support/runtime/stdexcept_vcruntime.ipp
58
58
system_error.cpp
Original file line number Diff line number Diff line change 10
10
#include < new>
11
11
#include < stdlib.h>
12
12
13
- #include " include/atomic_support.h"
14
-
15
- #if defined(_LIBCPP_ABI_MICROSOFT)
16
- # if !defined(_LIBCPP_ABI_VCRUNTIME)
17
- # include " support/runtime/new_handler_fallback.ipp"
18
- # endif
19
- #elif defined(LIBCXX_BUILDING_LIBCXXABI)
20
- # include < cxxabi.h>
21
- #elif defined(LIBCXXRT)
22
- # include < cxxabi.h>
23
- # include " support/runtime/new_handler_fallback.ipp"
24
- #elif defined(__GLIBCXX__)
25
- // nothing to do
26
- #else
27
- # include " support/runtime/new_handler_fallback.ipp"
28
- #endif
29
-
30
13
namespace std
31
14
{
32
15
Original file line number Diff line number Diff line change 1
- // -*- C++ -*-
2
1
// ===----------------------------------------------------------------------===//
3
2
//
4
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
7
6
//
8
7
// ===----------------------------------------------------------------------===//
9
8
10
- namespace std {
9
+ #include < new>
10
+
11
+ #include " include/atomic_support.h"
12
+
13
+ #if defined(_LIBCPP_ABI_MICROSOFT)
14
+ # if !defined(_LIBCPP_ABI_VCRUNTIME)
15
+ # define _LIBPCPP_DEFINE_NEW_HANDLER
16
+ # endif
17
+ #elif defined(LIBCXX_BUILDING_LIBCXXABI)
18
+ // nothing to do, we use the one from libc++abi
19
+ #elif defined(LIBCXXRT)
20
+ # define _LIBPCPP_DEFINE_NEW_HANDLER
21
+ #elif defined(__GLIBCXX__)
22
+ // nothing to do, we use the one from libstdc++/libsupc++
23
+ #else
24
+ # define _LIBPCPP_DEFINE_NEW_HANDLER
25
+ #endif
26
+
27
+ #if defined(_LIBPCPP_DEFINE_NEW_HANDLER)
28
+
29
+ namespace std { // purposefully not versioned
11
30
12
31
static constinit std::new_handler __new_handler = nullptr ;
13
32
@@ -24,3 +43,5 @@ get_new_handler() noexcept
24
43
}
25
44
26
45
} // namespace std
46
+
47
+ #endif // _LIBPCPP_DEFINE_NEW_HANDLER
Original file line number Diff line number Diff line change @@ -809,6 +809,7 @@ libcxx/src/memory.cpp
809
809
libcxx/src/mutex.cpp
810
810
libcxx/src/mutex_destructor.cpp
811
811
libcxx/src/new.cpp
812
+ libcxx/src/new_handler.cpp
812
813
libcxx/src/optional.cpp
813
814
libcxx/src/random.cpp
814
815
libcxx/src/random_shuffle.cpp
@@ -830,7 +831,6 @@ libcxx/src/support/runtime/exception_pointer_cxxabi.ipp
830
831
libcxx/src/support/runtime/exception_pointer_glibcxx.ipp
831
832
libcxx/src/support/runtime/exception_pointer_msvc.ipp
832
833
libcxx/src/support/runtime/exception_pointer_unimplemented.ipp
833
- libcxx/src/support/runtime/new_handler_fallback.ipp
834
834
libcxx/src/support/runtime/stdexcept_default.ipp
835
835
libcxx/src/support/runtime/stdexcept_vcruntime.ipp
836
836
libcxx/src/support/win32/locale_win32.cpp
You can’t perform that action at this time.
0 commit comments