xref: /freebsd-src/contrib/llvm-project/libcxx/include/__exception/operations.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
106c3fb27SDimitry Andric //===----------------------------------------------------------------------===//
206c3fb27SDimitry Andric //
306c3fb27SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
406c3fb27SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
506c3fb27SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
606c3fb27SDimitry Andric //
706c3fb27SDimitry Andric //===----------------------------------------------------------------------===//
806c3fb27SDimitry Andric 
906c3fb27SDimitry Andric #ifndef _LIBCPP___EXCEPTION_OPERATIONS_H
1006c3fb27SDimitry Andric #define _LIBCPP___EXCEPTION_OPERATIONS_H
1106c3fb27SDimitry Andric 
1206c3fb27SDimitry Andric #include <__config>
1306c3fb27SDimitry Andric #include <cstddef>
1406c3fb27SDimitry Andric 
1506c3fb27SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1606c3fb27SDimitry Andric #  pragma GCC system_header
1706c3fb27SDimitry Andric #endif
1806c3fb27SDimitry Andric 
1906c3fb27SDimitry Andric namespace std { // purposefully not using versioning namespace
2006c3fb27SDimitry Andric #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) ||                             \
2106c3fb27SDimitry Andric     defined(_LIBCPP_BUILDING_LIBRARY)
2206c3fb27SDimitry Andric using unexpected_handler = void (*)();
2306c3fb27SDimitry Andric _LIBCPP_EXPORTED_FROM_ABI unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
2406c3fb27SDimitry Andric _LIBCPP_EXPORTED_FROM_ABI unexpected_handler get_unexpected() _NOEXCEPT;
2506c3fb27SDimitry Andric _LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void unexpected();
2606c3fb27SDimitry Andric #endif
2706c3fb27SDimitry Andric 
2806c3fb27SDimitry Andric using terminate_handler = void (*)();
2906c3fb27SDimitry Andric _LIBCPP_EXPORTED_FROM_ABI terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
3006c3fb27SDimitry Andric _LIBCPP_EXPORTED_FROM_ABI terminate_handler get_terminate() _NOEXCEPT;
3106c3fb27SDimitry Andric 
3206c3fb27SDimitry Andric _LIBCPP_EXPORTED_FROM_ABI bool uncaught_exception() _NOEXCEPT;
33*5f757f3fSDimitry Andric _LIBCPP_EXPORTED_FROM_ABI int uncaught_exceptions() _NOEXCEPT;
3406c3fb27SDimitry Andric 
3506c3fb27SDimitry Andric class _LIBCPP_EXPORTED_FROM_ABI exception_ptr;
3606c3fb27SDimitry Andric 
3706c3fb27SDimitry Andric _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
3806c3fb27SDimitry Andric _LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
3906c3fb27SDimitry Andric } // namespace std
4006c3fb27SDimitry Andric 
4106c3fb27SDimitry Andric #endif // _LIBCPP___EXCEPTION_OPERATIONS_H
42