This commit is contained in:
Dethrace Labs 2025-06-21 06:29:01 +12:00
parent 2512e9a8cf
commit 998a0b6af8
2 changed files with 24 additions and 13 deletions

@ -1 +1 @@
Subproject commit fa8b5a90dff141f6e7e1f4f146ac593779fe6cea
Subproject commit b13fe1a204ce68b90c784ba45a433e43a705d53b

View File

@ -6,7 +6,7 @@
extern int harness_debug_level;
void debug_printf(const char* fmt, const char* fn, const char* fmt2, ...);
void debug_printf(const char* fmt, const char* fn, const char* fmt2, ...);
void panic_printf(const char* fmt, const char* fn, const char* fmt2, ...);
void debug_print_vector3(const char* fmt, const char* fn, char* msg, br_vector3* v);
void debug_print_matrix34(const char* fmt, const char* fn, char* name, br_matrix34* m);
@ -14,6 +14,23 @@ void debug_print_matrix4(const char* fmt, const char* fn, char* name, br_matrix4
#define BLUE
#if _MSC_VER == 1020
#define LOG_TRACE()
#define LOG_TRACE8()
#define LOG_TRACE9()
#define LOG_TRACE10()
#define LOG_DEBUG()
#define LOG_INFO()
#define LOG_WARN()
#define LOG_PANIC()
#define LOG_WARN_ONCE()
#define NOT_IMPLEMENTED()
#define TELL_ME_IF_WE_PASS_THIS_WAY()
#define STUB_ONCE()
#else
#define LOG_TRACE(...) \
if (harness_debug_level >= 5) { \
debug_printf("[TRACE] %s", __FUNCTION__, __VA_ARGS__); \
@ -34,15 +51,12 @@ void debug_print_matrix4(const char* fmt, const char* fn, char* name, br_matrix4
}
#define LOG_DEBUG(...) debug_printf("\033[0;34m[DEBUG] %s ", __FUNCTION__, __VA_ARGS__)
#define LOG_VEC(msg, v) debug_print_vector3("\033[0;34m[DEBUG] %s ", __FUNCTION__, msg, v)
#define LOG_MATRIX(msg, m) debug_print_matrix34("\033[0;34m[DEBUG] %s ", __FUNCTION__, msg, m)
#define LOG_MATRIX4(msg, m) debug_print_matrix4("\033[0;34m[DEBUG] %s ", __FUNCTION__, msg, m)
#define LOG_INFO(...) debug_printf("[INFO] %s ", __FUNCTION__, __VA_ARGS__)
#define LOG_WARN(...) debug_printf("\033[0;33m[WARN] %s ", __FUNCTION__, __VA_ARGS__)
#define LOG_PANIC(...) \
do { \
#define LOG_PANIC(...) \
do { \
panic_printf("[PANIC] %s ", __FUNCTION__, __VA_ARGS__); \
abort(); \
abort(); \
} while (0)
#define LOG_WARN_ONCE(...) \
@ -58,9 +72,6 @@ void debug_print_matrix4(const char* fmt, const char* fn, char* name, br_matrix4
#define TELL_ME_IF_WE_PASS_THIS_WAY() \
LOG_PANIC("code path not expected")
#define STUB() \
debug_printf("\033[0;31m[WARN] %s ", __FUNCTION__, "%s", "stubbed");
#define STUB_ONCE() \
static int stub_printed = 0; \
if (!stub_printed) { \
@ -68,6 +79,6 @@ void debug_print_matrix4(const char* fmt, const char* fn, char* name, br_matrix4
stub_printed = 1; \
}
// int count_open_fds();
#endif
#endif // ifdef