Skip to content

Commit aee3a9f

Browse files
committed
[libc++][NFC] clang-format new_handler.cpp
1 parent 80e4cca commit aee3a9f

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

libcxx/src/new_handler.cpp

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
#include "include/atomic_support.h"
1212

1313
#if defined(_LIBCPP_ABI_MICROSOFT)
14-
# if !defined(_LIBCPP_ABI_VCRUNTIME)
15-
# define _LIBPCPP_DEFINE_NEW_HANDLER
16-
# endif
14+
# if !defined(_LIBCPP_ABI_VCRUNTIME)
15+
# define _LIBPCPP_DEFINE_NEW_HANDLER
16+
# endif
1717
#elif defined(LIBCXX_BUILDING_LIBCXXABI)
18-
// nothing to do, we use the one from libc++abi
18+
// nothing to do, we use the one from libc++abi
1919
#elif defined(LIBCXXRT)
20-
# define _LIBPCPP_DEFINE_NEW_HANDLER
20+
# define _LIBPCPP_DEFINE_NEW_HANDLER
2121
#elif defined(__GLIBCXX__)
22-
// nothing to do, we use the one from libstdc++/libsupc++
22+
// nothing to do, we use the one from libstdc++/libsupc++
2323
#else
24-
# define _LIBPCPP_DEFINE_NEW_HANDLER
24+
# define _LIBPCPP_DEFINE_NEW_HANDLER
2525
#endif
2626

2727
#if defined(_LIBPCPP_DEFINE_NEW_HANDLER)
@@ -30,17 +30,9 @@ namespace std { // purposefully not versioned
3030

3131
static constinit std::new_handler __new_handler = nullptr;
3232

33-
new_handler
34-
set_new_handler(new_handler handler) noexcept
35-
{
36-
return __libcpp_atomic_exchange(&__new_handler, handler);
37-
}
38-
39-
new_handler
40-
get_new_handler() noexcept
41-
{
42-
return __libcpp_atomic_load(&__new_handler);
43-
}
33+
new_handler set_new_handler(new_handler handler) noexcept { return __libcpp_atomic_exchange(&__new_handler, handler); }
34+
35+
new_handler get_new_handler() noexcept { return __libcpp_atomic_load(&__new_handler); }
4436

4537
} // namespace std
4638

libcxx/utils/data/ignore_format.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,6 @@ libcxx/src/memory.cpp
809809
libcxx/src/mutex.cpp
810810
libcxx/src/mutex_destructor.cpp
811811
libcxx/src/new.cpp
812-
libcxx/src/new_handler.cpp
813812
libcxx/src/optional.cpp
814813
libcxx/src/random.cpp
815814
libcxx/src/random_shuffle.cpp

0 commit comments

Comments
 (0)