2023-11-01 21:11:11 +00:00
|
|
|
// This file Copyright © 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
|
|
|
|
2023-07-06 15:00:07 +00:00
|
|
|
#if !defined(NDEBUG) || defined(TR_FORCE_ASSERTIONS)
|
|
|
|
|
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
|
|
|
|
2023-04-14 19:33:23 +00:00
|
|
|
#include "libtransmission/tr-assert.h"
|
2017-06-08 07:24:12 +00:00
|
|
|
|
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
|
|
|
{
|
2024-02-13 16:42:19 +00:00
|
|
|
std::cerr << "assertion failed: " << message << " (" << file << ':' << line << ")\n";
|
2017-06-08 07:24:12 +00:00
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|