master
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___ASSERTION_HANDLER
11#define _LIBCPP___ASSERTION_HANDLER
12
13#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
14# include <__cxx03/__config>
15# include <__cxx03/__verbose_abort>
16# include <__cxx03/__verbose_trap>
17#else
18# include <__config>
19# include <__verbose_abort>
20# include <__verbose_trap>
21#endif
22
23#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
24# pragma GCC system_header
25#endif
26
27#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
28
29# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message)
30
31#else
32
33# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_TRAP(message)
34
35#endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
36
37#endif // _LIBCPP___ASSERTION_HANDLER