mcl/assert: Flush stderr

This commit is contained in:
Merry 2022-04-23 19:37:17 +01:00
parent da45f689b9
commit 65ed1e7054
2 changed files with 2 additions and 1 deletions

View file

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR) cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
include(GNUInstallDirs) include(GNUInstallDirs)
project(mcl LANGUAGES CXX VERSION 0.1.7) project(mcl LANGUAGES CXX VERSION 0.1.8)
# Project options # Project options
option(MCL_WARNINGS_AS_ERRORS "Warnings as errors" ON) option(MCL_WARNINGS_AS_ERRORS "Warnings as errors" ON)

View file

@ -14,6 +14,7 @@ namespace mcl::detail {
[[noreturn]] void assert_terminate_impl(fmt::string_view msg, fmt::format_args args) { [[noreturn]] void assert_terminate_impl(fmt::string_view msg, fmt::format_args args) {
fmt::print(stderr, "assertion failed: "); fmt::print(stderr, "assertion failed: ");
fmt::vprint(stderr, msg, args); fmt::vprint(stderr, msg, args);
std::fflush(stderr);
std::terminate(); std::terminate();
} }