• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // NOLINT(llvm-header-guard) https://github.com/llvm/llvm-project/issues/83339
2 //===-- Internal header for assert ------------------------------*- C++ -*-===//
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 #include "src/assert/__assert_fail.h"
11 
12 // There is no header guard here since assert is intended to be capable of being
13 // included multiple times with NDEBUG defined differently, causing different
14 // behavior.
15 
16 #undef assert
17 
18 #ifdef NDEBUG
19 #define assert(e) (void)0
20 #else
21 #define assert(e)                                                              \
22   ((e) ? (void)0                                                               \
23        : LIBC_NAMESPACE::__assert_fail(#e, __FILE__, __LINE__,                 \
24                                        __PRETTY_FUNCTION__))
25 #endif // NDEBUG
26