@@ -89,7 +89,7 @@ extern "C" {
8989 * - 3: Paranoid settings: All SDL assertion macros enabled, including
9090 * SDL_assert_paranoid.
9191 *
92- * \since This macro is available since SDL 3.1.3 .
92+ * \since This macro is available since SDL 3.2.0 .
9393 */
9494#define SDL_ASSERT_LEVEL SomeNumberBasedOnVariousFactors
9595
@@ -118,24 +118,27 @@ extern "C" {
118118 *
119119 * If the program is not running under a debugger, SDL_TriggerBreakpoint will
120120 * likely terminate the app, possibly without warning. If the current platform
121- * isn't supported (SDL doesn't know how to trigger a breakpoint), this macro
122- * does nothing.
121+ * isn't supported, this macro is left undefined.
123122 *
124123 * \threadsafety It is safe to call this macro from any thread.
125124 *
126- * \since This macro is available since SDL 3.1.3 .
125+ * \since This macro is available since SDL 3.2.0 .
127126 */
128127#define SDL_TriggerBreakpoint () TriggerABreakpointInAPlatformSpecificManner
129128
130- #elif defined(_MSC_VER )
129+ #elif defined(_MSC_VER ) && _MSC_VER >= 1310
131130 /* Don't include intrin.h here because it contains C++ code */
132131 extern void __cdecl __debugbreak (void );
133132 #define SDL_TriggerBreakpoint () __debugbreak()
133+ #elif defined(_MSC_VER ) && defined(_M_IX86 )
134+ #define SDL_TriggerBreakpoint () { _asm { int 0x03 } }
134135#elif defined(ANDROID )
135136 #include <assert.h>
136137 #define SDL_TriggerBreakpoint () assert(0)
137138#elif SDL_HAS_BUILTIN (__builtin_debugtrap )
138139 #define SDL_TriggerBreakpoint () __builtin_debugtrap()
140+ #elif SDL_HAS_BUILTIN (__builtin_trap )
141+ #define SDL_TriggerBreakpoint () __builtin_trap()
139142#elif (defined(__GNUC__ ) || defined(__clang__ )) && (defined(__i386__ ) || defined(__x86_64__ ))
140143 #define SDL_TriggerBreakpoint () __asm__ __volatile__ ( "int $3\n\t" )
141144#elif (defined(__GNUC__ ) || defined(__clang__ )) && defined(__riscv )
@@ -152,8 +155,7 @@ extern "C" {
152155 #include <signal.h>
153156 #define SDL_TriggerBreakpoint () raise(SIGTRAP)
154157#else
155- /* How do we trigger breakpoints on this platform? */
156- #define SDL_TriggerBreakpoint ()
158+ /* SDL_TriggerBreakpoint is intentionally left undefined on unknown platforms. */
157159#endif
158160
159161#ifdef SDL_WIKI_DOCUMENTATION_SECTION
@@ -163,7 +165,7 @@ extern "C" {
163165 *
164166 * If SDL can't figure how the compiler reports this, it will use "???".
165167 *
166- * \since This macro is available since SDL 3.1.3 .
168+ * \since This macro is available since SDL 3.2.0 .
167169 */
168170#define SDL_FUNCTION __FUNCTION__
169171
@@ -178,14 +180,14 @@ extern "C" {
178180/**
179181 * A macro that reports the current file being compiled.
180182 *
181- * \since This macro is available since SDL 3.1.3 .
183+ * \since This macro is available since SDL 3.2.0 .
182184 */
183185#define SDL_FILE __FILE__
184186
185187/**
186188 * A macro that reports the current line number of the file being compiled.
187189 *
188- * \since This macro is available since SDL 3.1.3 .
190+ * \since This macro is available since SDL 3.2.0 .
189191 */
190192#define SDL_LINE __LINE__
191193
@@ -222,7 +224,7 @@ disable assertions.
222224 * do { SomethingOnce(); } while (SDL_NULL_WHILE_LOOP_CONDITION (0));
223225 * ```
224226 *
225- * \since This macro is available since SDL 3.1.3 .
227+ * \since This macro is available since SDL 3.2.0 .
226228 */
227229#define SDL_NULL_WHILE_LOOP_CONDITION (0)
228230
@@ -246,7 +248,7 @@ disable assertions.
246248 *
247249 * \param condition the condition to assert (but not actually run here).
248250 *
249- * \since This macro is available since SDL 3.1.3 .
251+ * \since This macro is available since SDL 3.2.0 .
250252 */
251253#define SDL_disabled_assert (condition ) \
252254 do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
@@ -262,7 +264,7 @@ disable assertions.
262264 * condition, try to break in a debugger, kill the program, or ignore the
263265 * problem).
264266 *
265- * \since This enum is available since SDL 3.1.3 .
267+ * \since This enum is available since SDL 3.2.0 .
266268 */
267269typedef enum SDL_AssertState
268270{
@@ -280,7 +282,7 @@ typedef enum SDL_AssertState
280282 * used by the assertion handler, then added to the assertion report. This is
281283 * returned as a linked list from SDL_GetAssertionReport().
282284 *
283- * \since This struct is available since SDL 3.1.3 .
285+ * \since This struct is available since SDL 3.2.0 .
284286 */
285287typedef struct SDL_AssertData
286288{
@@ -306,7 +308,7 @@ typedef struct SDL_AssertData
306308 *
307309 * \threadsafety It is safe to call this function from any thread.
308310 *
309- * \since This function is available since SDL 3.1.3 .
311+ * \since This function is available since SDL 3.2.0 .
310312 */
311313extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion (SDL_AssertData * data ,
312314 const char * func ,
@@ -321,7 +323,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
321323 * This isn't for direct use by apps; use SDL_assert or SDL_TriggerBreakpoint
322324 * instead.
323325 *
324- * \since This macro is available since SDL 3.1.3 .
326+ * \since This macro is available since SDL 3.2.0 .
325327 */
326328#define SDL_AssertBreakpoint () SDL_TriggerBreakpoint()
327329
@@ -353,7 +355,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
353355 *
354356 * \param condition the condition to assert.
355357 *
356- * \since This macro is available since SDL 3.1.3 .
358+ * \since This macro is available since SDL 3.2.0 .
357359 */
358360#define SDL_enabled_assert (condition ) \
359361 do { \
@@ -399,7 +401,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
399401 *
400402 * \threadsafety It is safe to call this macro from any thread.
401403 *
402- * \since This macro is available since SDL 3.1.3 .
404+ * \since This macro is available since SDL 3.2.0 .
403405 */
404406#define SDL_assert (condition ) if (assertion_enabled && (condition)) { trigger_assertion; }
405407
@@ -432,7 +434,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
432434 *
433435 * \threadsafety It is safe to call this macro from any thread.
434436 *
435- * \since This macro is available since SDL 3.1.3 .
437+ * \since This macro is available since SDL 3.2.0 .
436438 */
437439#define SDL_assert_release (condition ) SDL_disabled_assert(condition)
438440
@@ -461,7 +463,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
461463 *
462464 * \threadsafety It is safe to call this macro from any thread.
463465 *
464- * \since This macro is available since SDL 3.1.3 .
466+ * \since This macro is available since SDL 3.2.0 .
465467 */
466468#define SDL_assert_paranoid (condition ) SDL_disabled_assert(condition)
467469
@@ -505,7 +507,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
505507 *
506508 * \threadsafety It is safe to call this macro from any thread.
507509 *
508- * \since This macro is available since SDL 3.1.3 .
510+ * \since This macro is available since SDL 3.2.0 .
509511 */
510512#define SDL_assert_always (condition ) SDL_enabled_assert(condition)
511513
@@ -521,7 +523,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
521523 * \threadsafety This callback may be called from any thread that triggers an
522524 * assert at any time.
523525 *
524- * \since This datatype is available since SDL 3.1.3 .
526+ * \since This datatype is available since SDL 3.2.0 .
525527 */
526528typedef SDL_AssertState (SDLCALL * SDL_AssertionHandler )(
527529 const SDL_AssertData * data , void * userdata );
@@ -545,7 +547,7 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
545547 *
546548 * \threadsafety It is safe to call this function from any thread.
547549 *
548- * \since This function is available since SDL 3.1.3 .
550+ * \since This function is available since SDL 3.2.0 .
549551 *
550552 * \sa SDL_GetAssertionHandler
551553 */
@@ -566,7 +568,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler(
566568 *
567569 * \threadsafety It is safe to call this function from any thread.
568570 *
569- * \since This function is available since SDL 3.1.3 .
571+ * \since This function is available since SDL 3.2.0 .
570572 *
571573 * \sa SDL_GetAssertionHandler
572574 */
@@ -591,7 +593,7 @@ extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(
591593 *
592594 * \threadsafety It is safe to call this function from any thread.
593595 *
594- * \since This function is available since SDL 3.1.3 .
596+ * \since This function is available since SDL 3.2.0 .
595597 *
596598 * \sa SDL_SetAssertionHandler
597599 */
@@ -625,7 +627,7 @@ extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **
625627 * SDL_ResetAssertionReport() simultaneously, may render the
626628 * returned pointer invalid.
627629 *
628- * \since This function is available since SDL 3.1.3 .
630+ * \since This function is available since SDL 3.2.0 .
629631 *
630632 * \sa SDL_ResetAssertionReport
631633 */
@@ -643,7 +645,7 @@ extern SDL_DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
643645 * assertion, or simultaneously calling this function may cause
644646 * memory leaks or crashes.
645647 *
646- * \since This function is available since SDL 3.1.3 .
648+ * \since This function is available since SDL 3.2.0 .
647649 *
648650 * \sa SDL_GetAssertionReport
649651 */
0 commit comments