Browse Source

Improved SDL_main documentation and remove extern "C" comment.

It turns out that this is incorrect and any C linkage is already taken care of by SDL when redefining SDL_main.

Fixes https://github.com/libsdl-org/SDL/issues/11068
Sam Lantinga 6 months ago
parent
commit
fb07ab91c6
1 changed files with 13 additions and 20 deletions
  1. 13 20
      include/SDL3/SDL_main.h

+ 13 - 20
include/SDL3/SDL_main.h

@@ -22,13 +22,22 @@
 /**
  * # CategoryMain
  *
- * Redefine main() on some platforms so that it is called by SDL.
+ * Redefine main() if necessary so that it is called by SDL.
  *
- * For details on how SDL_main works, and how to use it, please refer to:
+ * In order to make this consistent on all platforms, the application's main()
+ * should look like this:
  *
- * https://wiki.libsdl.org/SDL3/README/main-functions
+ *  ```c
+ *  int main(int argc, char *argv[])
+ *  {
+ *  }
+ *  ```
+ *
+ * SDL will take care of platform specific details on how it gets called.
+ *
+ * For more information, see:
  *
- * (or docs/README-main-functions.md in the SDL source tree)
+ * https://wiki.libsdl.org/SDL3/README/main-functions
  */
 
 #ifndef SDL_main_h_
@@ -129,22 +138,6 @@
 #define SDLMAIN_DECLSPEC
 #endif
 
-/**
- *  \file SDL_main.h
- *
- *  The application's main() function must be called with C linkage,
- *  and should be declared like this:
- *
- *  ```c
- *  #ifdef __cplusplus
- *  extern "C"
- *  #endif
- *  int main(int argc, char *argv[])
- *  {
- *  }
- *  ```
- */
-
 #ifdef SDL_WIKI_DOCUMENTATION_SECTION
 
 /**