From 181e2d9b0d317f36cf3580fc669169e4c88293f2 Mon Sep 17 00:00:00 2001 From: Paul-Andre Henegar Date: Mon, 28 Jul 2025 02:15:35 -0400 Subject: [PATCH] Print accumulated errors before printing assert --- src/gb/gb.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gb/gb.h b/src/gb/gb.h index ffc40b8ca..70d2fdcc7 100644 --- a/src/gb/gb.h +++ b/src/gb/gb.h @@ -2509,7 +2509,13 @@ extern "C" { #pragma warning(disable:4127) // Conditional expression is constant #endif +gb_internal void print_all_errors(void); +gb_internal bool any_errors(void); +gb_internal bool any_warnings(void); void gb_assert_handler(char const *prefix, char const *condition, char const *file, i32 line, char const *msg, ...) { + if (any_errors() || any_warnings()) { + print_all_errors(); + } gb_printf_err("%s(%d): %s: ", file, line, prefix); if (condition) gb_printf_err( "`%s` ", condition);