1.1 --- a/include/SDL_main.h Fri Jun 28 22:42:10 2013 -0700
1.2 +++ b/include/SDL_main.h Fri Jun 28 22:44:49 2013 -0700
1.3 @@ -30,11 +30,33 @@
1.4 * Redefine main() on some platforms so that it is called by SDL.
1.5 */
1.6
1.7 -#if defined(__WIN32__) || defined(__IPHONEOS__) || defined(__ANDROID__)
1.8 #ifndef SDL_MAIN_HANDLED
1.9 +#if defined(__WIN32__)
1.10 +/* On Windows SDL provides WinMain(), which parses the command line and passes
1.11 + the arguments to your main function.
1.12 +
1.13 + If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
1.14 + */
1.15 +#define SDL_MAIN_AVAILABLE
1.16 +
1.17 +#elif defined(__IPHONEOS__)
1.18 +/* On iOS SDL provides a main function that creates an application delegate
1.19 + and starts the iOS application run loop.
1.20 +
1.21 + See src/video/uikit/SDL_uikitappdelegate.m for more details.
1.22 + */
1.23 #define SDL_MAIN_NEEDED
1.24 +
1.25 +#elif defined(__ANDROID__)
1.26 +/* On Android SDL provides a Java class in SDLActivity.java that is the
1.27 + main activity entry point.
1.28 +
1.29 + See README-android.txt for more details on extending that class.
1.30 + */
1.31 +#define SDL_MAIN_NEEDED
1.32 +
1.33 #endif
1.34 -#endif
1.35 +#endif /* SDL_MAIN_HANDLED */
1.36
1.37 #ifdef __cplusplus
1.38 #define C_LINKAGE "C"
1.39 @@ -57,7 +79,7 @@
1.40 * \endcode
1.41 */
1.42
1.43 -#ifdef SDL_MAIN_NEEDED
1.44 +#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
1.45 #define main SDL_main
1.46 #endif
1.47