SDL: SDL_main.h: Document SDL_MAIN_USE_CALLBACKS.

From d570fd7c2c0d4776f268bd91c0b3c48559202a74 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Fri, 3 May 2024 09:40:35 -0400
Subject: [PATCH] SDL_main.h: Document SDL_MAIN_USE_CALLBACKS.

---
 include/SDL3/SDL_main.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/include/SDL3/SDL_main.h b/include/SDL3/SDL_main.h
index afb80df50f5ab..47d12da92cf3e 100644
--- a/include/SDL3/SDL_main.h
+++ b/include/SDL3/SDL_main.h
@@ -151,6 +151,31 @@
  *  ```
  */
 
+#ifdef SDL_WIKI_DOCUMENTATION_SECTION
+/**
+ * Inform SDL to use the main callbacks instead of main.
+ *
+ * SDL does not define this macro, but will check if it is defined to
+ * any value in SDL_main.h. If defined, SDL will expect the app
+ * to provide several functions: SDL_AppInit, SDL_AppEvent,
+ * SDL_AppIterate, and SDL_AppQuit. The app should not provide
+ * a `main` function in this case, and doing so will likely cause
+ * the build to fail.
+ *
+ * Please see [README/main-functions](README/main-functions), (or
+ * docs/README-main-functions.md in the source tree) for a more
+ * detailed explanation.
+ *
+ * \since This macro is used by the headers since SDL 3.0.0.
+ *
+ * \sa SDL_AppInit
+ * \sa SDL_AppEvent
+ * \sa SDL_AppIterate
+ * \sa SDL_AppQuit
+ */
+#define SDL_MAIN_USE_CALLBACKS 1
+#endif
+
 #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) || defined(SDL_MAIN_USE_CALLBACKS)
 #define main SDL_main
 #endif