equal
deleted
inserted
replaced
118 #if (SDL_ASSERT_LEVEL > 0) |
118 #if (SDL_ASSERT_LEVEL > 0) |
119 |
119 |
120 /* Never call this directly. Use the SDL_assert* macros. */ |
120 /* Never call this directly. Use the SDL_assert* macros. */ |
121 extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, |
121 extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, |
122 const char *, |
122 const char *, |
123 const char *, int); |
123 const char *, int) |
|
124 #if defined(__clang__) && __has_feature(attribute_analyzer_noreturn) |
|
125 /* this tells Clang's static analysis that we're a custom assert function, |
|
126 and that the analyzer should assume the condition was always true past this |
|
127 SDL_assert test. */ |
|
128 __attribute__((analyzer_noreturn)) |
|
129 #endif |
|
130 ; |
124 |
131 |
125 /* the do {} while(0) avoids dangling else problems: |
132 /* the do {} while(0) avoids dangling else problems: |
126 if (x) SDL_assert(y); else blah(); |
133 if (x) SDL_assert(y); else blah(); |
127 ... without the do/while, the "else" could attach to this macro's "if". |
134 ... without the do/while, the "else" could attach to this macro's "if". |
128 We try to handle just the minimum we need here in a macro...the loop, |
135 We try to handle just the minimum we need here in a macro...the loop, |