Path: blob/main/system/lib/libcxxabi/src/cxa_handlers.h
6189 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//7// This file implements the functionality associated with the terminate_handler,8// unexpected_handler, and new_handler.9//===----------------------------------------------------------------------===//1011#ifndef _CXA_HANDLERS_H12#define _CXA_HANDLERS_H1314#include "__cxxabi_config.h"1516#include <exception>1718namespace std19{2021_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN22void23__unexpected(unexpected_handler func);2425_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN26void27__terminate(terminate_handler func) noexcept;2829} // std3031extern "C"32{3334_LIBCXXABI_DATA_VIS extern void (*__cxa_terminate_handler)();35_LIBCXXABI_DATA_VIS extern void (*__cxa_unexpected_handler)();36_LIBCXXABI_DATA_VIS extern void (*__cxa_new_handler)();3738/*3940At some point in the future these three symbols will become41C++11 atomic variables:4243extern std::atomic<std::terminate_handler> __cxa_terminate_handler;44extern std::atomic<std::unexpected_handler> __cxa_unexpected_handler;45extern std::atomic<std::new_handler> __cxa_new_handler;4647This change will not impact their ABI. But it will allow for a48portable performance optimization.4950*/5152} // extern "C"5354#endif // _CXA_HANDLERS_H555657