[clang] Handle __declspec() attributes in using
[llvm-project.git] / libcxxabi / src / cxa_handlers.h
blob3d8dc6b2de95e421320b438828bdbf68212f77d2
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //
8 // This file implements the functionality associated with the terminate_handler,
9 // unexpected_handler, and new_handler.
10 //===----------------------------------------------------------------------===//
12 #ifndef _CXA_HANDLERS_H
13 #define _CXA_HANDLERS_H
15 #include "__cxxabi_config.h"
17 #include <exception>
19 namespace std
22 _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
23 void
24 __unexpected(unexpected_handler func);
26 _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
27 void
28 __terminate(terminate_handler func) noexcept;
30 } // std
32 extern "C"
35 _LIBCXXABI_DATA_VIS extern void (*__cxa_terminate_handler)();
36 _LIBCXXABI_DATA_VIS extern void (*__cxa_unexpected_handler)();
37 _LIBCXXABI_DATA_VIS extern void (*__cxa_new_handler)();
41 At some point in the future these three symbols will become
42 C++11 atomic variables:
44 extern std::atomic<std::terminate_handler> __cxa_terminate_handler;
45 extern std::atomic<std::unexpected_handler> __cxa_unexpected_handler;
46 extern std::atomic<std::new_handler> __cxa_new_handler;
48 This change will not impact their ABI. But it will allow for a
49 portable performance optimization.
53 } // extern "C"
55 #endif // _CXA_HANDLERS_H