2023-02-11 20:49:42 +00:00
|
|
|
// This file Copyright © 2017-2023 Mnemosyne LLC.
|
2022-02-07 16:25:02 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2017-06-08 07:24:12 +00:00
|
|
|
|
2021-10-17 20:17:18 +00:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
2022-04-01 23:00:51 +00:00
|
|
|
#include <iostream>
|
2022-07-26 02:45:54 +00:00
|
|
|
#include <string_view>
|
2017-06-08 07:24:12 +00:00
|
|
|
|
|
|
|
#include "tr-assert.h"
|
|
|
|
|
|
|
|
#if !defined(NDEBUG) || defined(TR_FORCE_ASSERTIONS)
|
|
|
|
|
2022-12-18 16:23:44 +00:00
|
|
|
[[noreturn]] bool tr_assert_report(std::string_view file, long line, std::string_view message)
|
2017-06-08 07:24:12 +00:00
|
|
|
{
|
2022-04-01 23:00:51 +00:00
|
|
|
std::cerr << "assertion failed: " << message << " (" << file << ':' << line << ')' << std::endl;
|
2017-06-08 07:24:12 +00:00
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|