Commit 12211df669c26ed820d08dc4930ccf3992e8bd10

pionere 2022-02-05T10:44:26

hide SDL_GenerateAssertionReport in case SDL_ASSERT_LEVEL is 0 otherwise SDL_PromptAssertion (and SDL_GenerateAssertionReport) can not be eliminated

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/SDL_assert.c b/src/SDL_assert.c
index 8153bf9..aa8d235 100644
--- a/src/SDL_assert.c
+++ b/src/SDL_assert.c
@@ -411,6 +411,7 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file,
 
 void SDL_AssertionsQuit(void)
 {
+#if SDL_ASSERT_LEVEL > 0
     SDL_GenerateAssertionReport();
 #ifndef SDL_THREADS_DISABLED
     if (assertion_mutex != NULL) {
@@ -418,6 +419,7 @@ void SDL_AssertionsQuit(void)
         assertion_mutex = NULL;
     }
 #endif
+#endif /* SDL_ASSERT_LEVEL > 0 */
 }
 
 void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata)