abort
parent
cc788e98f4
commit
ac163a34b9
|
@ -1,7 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
include(cmake/color.cmake)
|
include(cmake/color.cmake)
|
||||||
|
|
||||||
set(BLT_VERSION 0.17.17)
|
set(BLT_VERSION 0.17.18)
|
||||||
set(BLT_TEST_VERSION 0.0.1)
|
set(BLT_TEST_VERSION 0.0.1)
|
||||||
|
|
||||||
set(BLT_TARGET BLT)
|
set(BLT_TARGET BLT)
|
||||||
|
|
|
@ -16,6 +16,8 @@ namespace blt
|
||||||
void b_assert_failed(const char* expression, const char* msg, const char* path, int line);
|
void b_assert_failed(const char* expression, const char* msg, const char* path, int line);
|
||||||
|
|
||||||
void b_throw(const char* what, const char* path, int line);
|
void b_throw(const char* what, const char* path, int line);
|
||||||
|
|
||||||
|
void b_abort(const char* what, const char* path, int line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,4 +56,6 @@ namespace blt
|
||||||
#define BLT_THROW(throwable) do {blt::b_throw(throwable.what(), __FILE__, __LINE__); throw throwable;} while(0)
|
#define BLT_THROW(throwable) do {blt::b_throw(throwable.what(), __FILE__, __LINE__); throw throwable;} while(0)
|
||||||
|
|
||||||
|
|
||||||
|
#define BLT_ABORT(message) do {blt::b_abort(message, __FILE__, __LINE__); } while (0)
|
||||||
|
|
||||||
#endif //BLT_ASSERT_H
|
#endif //BLT_ASSERT_H
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 10368163ab1f4367d2f0685b5928b1c973ebd1ec
|
Subproject commit d88c5e15079047777b418132ece5879e7c9aaa2b
|
|
@ -124,5 +124,21 @@ namespace blt {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void b_abort(const char* what, const char* path, int line)
|
||||||
|
{
|
||||||
|
#if defined(__GNUC__) && !defined(__EMSCRIPTEN__)
|
||||||
|
BLT_STACK_TRACE(50);
|
||||||
|
#endif
|
||||||
|
BLT_FATAL("----{ABORT}----");
|
||||||
|
BLT_FATAL("\tWhat: ", what);
|
||||||
|
BLT_FATAL("\tcalled from %s:%d", path, line);
|
||||||
|
#if defined(__GNUC__) && !defined(__EMSCRIPTEN__)
|
||||||
|
printStacktrace(messages, size, path, line);
|
||||||
|
|
||||||
|
BLT_FREE_STACK_TRACE();
|
||||||
|
#endif
|
||||||
|
std::exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue