| 1234567891011121314151617181920212223 |
- export module Core.Assert;
- import Core.Std;
- import Core.Utility;
- import Core.Logger;
- export namespace Core {
- #ifdef NDEBUG
- void inline assert(bool) {
- }
- #else
- void inline assert(
- bool b, const std::source_location& l =
- std::source_location::current()) noexcept {
- if(!b) {
- Core::logError(
- FormatLocation("Assert in function {}", l),
- getShortFileName(l.file_name()), l.line(), l.function_name());
- exitWithHandler(1, l);
- }
- }
- #endif
- }
|