1 // NOLINT(llvm-header-guard) https://github.com/llvm/llvm-project/issues/83339
2 //===-- Internal header for assert ------------------------------*- C++ -*-===//
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
8 //===----------------------------------------------------------------------===//
10 #include "src/assert/__assert_fail.h"
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
19 #define assert(e) (void)0
23 #if __has_builtin(__builtin_expect)
24 #define __LIBC_ASSERT_LIKELY(e) __builtin_expect(e, 1)
27 #ifndef __LIBC_ASSERT_LIKELY
28 #define __LIBC_ASSERT_LIKELY(e) e
32 (__LIBC_ASSERT_LIKELY(e) ? (void)0 \
33 : LIBC_NAMESPACE::__assert_fail( \
34 #e, __FILE__, __LINE__, __PRETTY_FUNCTION__))