|
@@ -36,7 +36,27 @@
|
|
|
extern "C" {
|
|
|
#endif
|
|
|
|
|
|
-#ifndef SDL_ASSERT_LEVEL
|
|
|
+#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
|
|
+
|
|
|
+/**
|
|
|
+ * The level of assertion aggressiveness.
|
|
|
+ *
|
|
|
+ * This value changes depending on compiler options and other
|
|
|
+ * preprocessor defines.
|
|
|
+ *
|
|
|
+ * It is currently one of the following values, but future SDL
|
|
|
+ * releases might add more:
|
|
|
+ *
|
|
|
+ * - 0: All SDL assertion macros are disabled.
|
|
|
+ * - 1: Release settings: SDL_assert disabled, SDL_assert_release enabled.
|
|
|
+ * - 2: Debug settings: SDL_assert and SDL_assert_release enabled.
|
|
|
+ * - 3: Paranoid settings: All SDL assertion macros enabled, including SDL_assert_paranoid.
|
|
|
+ *
|
|
|
+ * \since This macro is available since SDL 3.0.0.
|
|
|
+ */
|
|
|
+#define SDL_ASSERT_LEVEL SomeNumberBasedOnVariousFactors
|
|
|
+
|
|
|
+#elif !defined(SDL_ASSERT_LEVEL)
|
|
|
#ifdef SDL_DEFAULT_ASSERT_LEVEL
|
|
|
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
|
|
|
#elif defined(_DEBUG) || defined(DEBUG) || \
|
|
@@ -45,7 +65,7 @@ extern "C" {
|
|
|
#else
|
|
|
#define SDL_ASSERT_LEVEL 1
|
|
|
#endif
|
|
|
-#endif /* SDL_ASSERT_LEVEL */
|
|
|
+#endif
|
|
|
|
|
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
|
|
|
|
@@ -233,7 +253,6 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data
|
|
|
} \
|
|
|
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
|
|
|
|
|
-/* Enable various levels of assertions. */
|
|
|
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
|
|
|
|
|
/**
|
|
@@ -333,6 +352,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data
|
|
|
#define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
|
|
#endif
|
|
|
|
|
|
+/* Enable various levels of assertions. */
|
|
|
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
|
|
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
|
|
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
|
|
@@ -385,6 +405,8 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data
|
|
|
* current assertion
|
|
|
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
|
|
|
* \returns an SDL_AssertState value indicating how to handle the failure.
|
|
|
+ *
|
|
|
+ * \since This datatype is available since SDL 3.0.0.
|
|
|
*/
|
|
|
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
|
|
const SDL_AssertData* data, void* userdata);
|