mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 16:28:30 +00:00
Upgrade to 2022-era LLVM LIBCXX
This commit is contained in:
parent
2f4ca71f26
commit
8e68384e15
2078 changed files with 165657 additions and 65010 deletions
60
third_party/libcxx/__verbose_abort
vendored
Normal file
60
third_party/libcxx/__verbose_abort
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
// -*- C++ -*-
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP___VERBOSE_ABORT
|
||||
#define _LIBCPP___VERBOSE_ABORT
|
||||
|
||||
#include <__availability>
|
||||
#include <__config>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
// This function should never be called directly from the code -- it should only be called through
|
||||
// the _LIBCPP_VERBOSE_ABORT macro.
|
||||
_LIBCPP_NORETURN _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2)
|
||||
void __libcpp_verbose_abort(const char *__format, ...);
|
||||
|
||||
// _LIBCPP_VERBOSE_ABORT(format, args...)
|
||||
//
|
||||
// This macro is used to abort the program abnormally while providing additional diagnostic information.
|
||||
//
|
||||
// The first argument is a printf-style format string, and the remaining arguments are values to format
|
||||
// into the format-string. This macro can be customized by users to provide fine-grained control over
|
||||
// how verbose termination is triggered.
|
||||
//
|
||||
// If the user does not supply their own version of the _LIBCPP_VERBOSE_ABORT macro, we pick the default
|
||||
// behavior based on whether we know the built library we're running against provides support for the
|
||||
// verbose termination handler or not. If it does, we call it. If it doesn't, we call __builtin_abort to
|
||||
// make sure that the program terminates but without taking any complex dependencies in this header.
|
||||
#if !defined(_LIBCPP_VERBOSE_ABORT)
|
||||
|
||||
// Support _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED until LLVM 18, but tell people
|
||||
// to move to customizing _LIBCPP_VERBOSE_ABORT instead.
|
||||
# if defined(_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT) && defined(_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED)
|
||||
# undef _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
|
||||
# warning _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED is deprecated, please customize _LIBCPP_VERBOSE_ABORT instead
|
||||
# endif
|
||||
|
||||
# if defined(_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT)
|
||||
// The decltype is there to suppress -Wunused warnings in this configuration.
|
||||
void __use(const char*, ...);
|
||||
# define _LIBCPP_VERBOSE_ABORT(...) (decltype(::std::__use(__VA_ARGS__))(), __builtin_abort())
|
||||
# else
|
||||
# define _LIBCPP_VERBOSE_ABORT(...) ::std::__libcpp_verbose_abort(__VA_ARGS__)
|
||||
# endif
|
||||
|
||||
#endif // !defined(_LIBCPP_VERBOSE_ABORT)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP___VERBOSE_ABORT
|
Loading…
Add table
Add a link
Reference in a new issue