wikiheaders: bridge wiki Category docs to the headers!

Did an initial cleanup on the headers and wrote a few pieces of documentation,
but this needs more work to fill out the documentation.
This commit is contained in:
Ryan C. Gordon
2024-05-16 10:44:37 -04:00
parent 558630d59c
commit 5e6d85b8f0
68 changed files with 617 additions and 388 deletions

View File

@@ -20,9 +20,39 @@
*/
/**
* \file SDL_assert.h
* # CategoryAssert
*
* Header file for assertion SDL API functions
* A helpful assertion macro!
*
* SDL assertions operate like your usual `assert` macro, but with some added
* features:
*
* - It uses a trick with the `sizeof` operator, so disabled assertions
* vaporize out of the compiled code, but variables only referenced in the
* assertion won't trigger compiler warnings about being unused.
* - It is safe to use with a dangling-else: `if (x) SDL_assert(y); else
* do_something();`
* - It works the same everywhere, instead of counting on various platforms'
* compiler and C runtime to behave.
* - It provides multiple levels of assertion (SDL_assert, SDL_assert_release,
* SDL_assert_paranoid) instead of a single all-or-nothing option.
* - It offers a variety of responses when an assertion fails (retry, trigger
* the debugger, abort the program, ignore the failure once, ignore it for
* the rest of the program's run).
* - It tries to show the user a dialog by default, if possible, but the app
* can provide a callback to handle assertion failures however they like.
* - It lets failed assertions be retried. Perhaps you had a network failure
* and just want to retry the test after plugging your network cable back
* in? You can.
* - It lets the user ignore an assertion failure, if there's a harmless
* problem that one can continue past.
* - It lets the user mark an assertion as ignored for the rest of the
* program's run; if there's a harmless problem that keeps popping up.
* - It provides statistics and data on all failed assertions to the app.
* - It allows the default assertion handler to be controlled with environment
* variables, in case an automated script needs to control it.
*
* To use it: do a debug build and just sprinkle around tests check your code!
*/
#ifndef SDL_assert_h_