From bb59f46cbe3dae9e6da633e53af48765675f46b8 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 9 Mar 2023 20:51:50 +0300
Subject: [PATCH] Removed guard around the enabled assertions support code
Otherwise, SDL_assert_always() wouldn't work.
Fixes https://github.com/libsdl-org/SDL/issues/7433
---
include/SDL3/SDL_assert.h | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/include/SDL3/SDL_assert.h b/include/SDL3/SDL_assert.h
index 830fb3a98f7b..6fc5fa5002ca 100644
--- a/include/SDL3/SDL_assert.h
+++ b/include/SDL3/SDL_assert.h
@@ -134,8 +134,6 @@ typedef struct SDL_AssertData
const struct SDL_AssertData *next;
} SDL_AssertData;
-#if (SDL_ASSERT_LEVEL > 0)
-
/**
* Never call this directly.
*
@@ -183,9 +181,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data
#define SDL_enabled_assert(condition) \
do { \
while ( !(condition) ) { \
- static struct SDL_AssertData sdl_assert_data = { \
- 0, 0, #condition, 0, 0, 0, 0 \
- }; \
+ static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
continue; /* go again. */ \
@@ -196,8 +192,6 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data
} \
} while (SDL_NULL_WHILE_LOOP_CONDITION)
-#endif /* enabled assertions support code */
-
/* Enable various levels of assertions. */
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
# define SDL_assert(condition) SDL_disabled_assert(condition)