-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile tests with _LIBCPP_ENABLE_ASSERTIONS and _GLIBCXX_ASSERTIONS, and _FORTITY_SOURCE allow standard libraries to perform additional checks.
- Loading branch information
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2024 Morwenn. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
#include <version> | ||
|
||
#ifdef _LIBCPP_VERSION | ||
#if defined(_LIBCPP_ENABLE_ASSERTIONS) && _LIBCPP_ENABLE_ASSERTIONS | ||
|
||
#include <cstdarg> | ||
#include <cstdio> | ||
#include <cstdlib> | ||
|
||
namespace std::inline __1 | ||
{ | ||
/* | ||
* Required to avoid linking issues with AppleClang when | ||
* compiling with _LIBCPP_ENABLE_ASSERTIONS. | ||
* See https://releases.llvm.org/16.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode | ||
*/ | ||
[[noreturn]] | ||
void __libcpp_verbose_abort(char const* format, ...) { | ||
std::va_list list; | ||
va_start(list, format); | ||
std::vfprintf(stderr, format, list); | ||
va_end(list); | ||
|
||
std::abort(); | ||
} | ||
} | ||
|
||
#endif | ||
#endif |