Warning, /include/c++/v1/__assertion_handler is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP___ASSERTION_HANDLER
0011 #define _LIBCPP___ASSERTION_HANDLER
0012
0013 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0014 # include <__cxx03/__config>
0015 # include <__cxx03/__verbose_abort>
0016 #else
0017 # include <__config>
0018 # include <__verbose_abort>
0019 #endif
0020
0021 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0022 # pragma GCC system_header
0023 #endif
0024
0025 #if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
0026
0027 # define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message)
0028
0029 #else
0030
0031 # if __has_builtin(__builtin_verbose_trap)
0032 // AppleClang shipped a slightly different version of __builtin_verbose_trap from the upstream
0033 // version before upstream Clang actually got the builtin.
0034 // TODO: Remove once AppleClang supports the two-arguments version of the builtin.
0035 # if defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 1700
0036 # define _LIBCPP_ASSERTION_HANDLER(message) __builtin_verbose_trap(message)
0037 # else
0038 # define _LIBCPP_ASSERTION_HANDLER(message) __builtin_verbose_trap("libc++", message)
0039 # endif
0040 # else
0041 # define _LIBCPP_ASSERTION_HANDLER(message) ((void)message, __builtin_trap())
0042 # endif
0043
0044 #endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
0045
0046 #endif // _LIBCPP___ASSERTION_HANDLER