This has the benefit of consistent placement for these macros (outside the namespace, not inside it). This, in turn, makes it more obvious that the condition applies to the entire namespace scope. Compile times are also reduced a bit, since the compiler doesn't have to open a namespace just to close it again. This is enforced with a clang-tidy check. As a drive-by this also fixes a few macro comments.
25 lines
800 B
C++
25 lines
800 B
C++
// -*- 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_TRAP
|
|
#define _LIBCPP___VERBOSE_TRAP
|
|
|
|
#include <__config>
|
|
|
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
|
# pragma GCC system_header
|
|
#endif
|
|
|
|
#if __has_builtin(__builtin_verbose_trap)
|
|
# define _LIBCPP_VERBOSE_TRAP(message) __builtin_verbose_trap("libc++", message)
|
|
#else
|
|
# define _LIBCPP_VERBOSE_TRAP(message) ((void)message, __builtin_trap())
|
|
#endif
|
|
|
|
#endif // _LIBCPP___VERBOSE_TRAP
|