25 lines
539 B
C++
25 lines
539 B
C++
// Copyright (c) 2024 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#include "assert.hpp"
|
|
|
|
void assertTrueImplement(
|
|
const char *file,
|
|
const int32_t line,
|
|
const char *func,
|
|
const bool_t result,
|
|
const char *message,
|
|
...
|
|
) {
|
|
if(!result) {
|
|
va_list args;
|
|
va_start(args, message);
|
|
fprintf(stderr, "Assertion failed in %s:%d (%s): ", file, line, func);
|
|
vfprintf(stderr, message, args);
|
|
fprintf(stderr, "\n");
|
|
va_end(args);
|
|
exit(1);
|
|
}
|
|
} |