From 0827d7a539d1e98eec22c51d44ee70ac42f2553a Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Mon, 10 Aug 2026 13:00:10 -0400 Subject: [PATCH] [Fix] (MobileGL): define the numeric log levels in Defines.h - the MOBILEGL_ASSERT gate compared undefined tokens in TUs that never include Log.h --- MobileGL/Defines.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MobileGL/Defines.h b/MobileGL/Defines.h index 31663ca8..293c2ac7 100644 --- a/MobileGL/Defines.h +++ b/MobileGL/Defines.h @@ -37,6 +37,19 @@ #define MOBILEGL_WGL_API MOBILEGL_API // ====================== MobileGL configurations ======================= // +// The numeric log levels live here, not only in Log.h: MOBILEGL_ASSERT below compares +// MOBILEGL_LOG_ACTIVE_LEVEL against MOBILEGL_LOG_LEVEL_DEBUG, and in a translation unit +// that includes Defines.h without Log.h both tokens would silently evaluate to 0 in the +// preprocessor conditional - enabling the assert in exactly the INFO-level builds it is +// documented to be compiled out of. Log.h redefines them identically, which is legal. +#ifndef MOBILEGL_LOG_LEVEL_DEBUG +#define MOBILEGL_LOG_LEVEL_DEBUG 0 +#define MOBILEGL_LOG_LEVEL_WARN 1 +#define MOBILEGL_LOG_LEVEL_ERROR 2 +#define MOBILEGL_LOG_LEVEL_INFO 3 +#define MOBILEGL_LOG_LEVEL_FATAL 4 +#endif + #ifndef MOBILEGL_LOG_ACTIVE_LEVEL #define MOBILEGL_LOG_ACTIVE_LEVEL MOBILEGL_LOG_LEVEL_INFO #endif