include/SDL_main.h
changeset 5320 e4add1082c2e
parent 5262 b530ef003506
child 5535 96594ac5fd1a
     1.1 --- a/include/SDL_main.h	Wed Feb 16 12:15:04 2011 -0800
     1.2 +++ b/include/SDL_main.h	Wed Feb 16 12:27:29 2011 -0800
     1.3 @@ -31,10 +31,11 @@
     1.4   *  Redefine main() on some platforms so that it is called by SDL.
     1.5   */
     1.6  
     1.7 -#if defined(__WIN32__) || \
     1.8 -    (defined(__MWERKS__) && !defined(__BEOS__)) || \
     1.9 -    defined(__SYMBIAN32__) || defined(__IPHONEOS__) || \
    1.10 -    defined(__ANDROID__)
    1.11 +#if defined(__WIN32__) || defined(__IPHONEOS__) || defined(__ANDROID__)
    1.12 +#ifndef SDL_MAIN_HANDLED
    1.13 +#define SDL_MAIN_NEEDED
    1.14 +#endif
    1.15 +#endif
    1.16  
    1.17  #ifdef __cplusplus
    1.18  #define C_LINKAGE	"C"
    1.19 @@ -57,7 +58,9 @@
    1.20   *  \endcode
    1.21   */
    1.22  
    1.23 +#ifdef SDL_MAIN_NEEDED
    1.24  #define main	SDL_main
    1.25 +#endif
    1.26  
    1.27  /**
    1.28   *  The prototype for the application's main() function
    1.29 @@ -65,9 +68,6 @@
    1.30  extern C_LINKAGE int SDL_main(int argc, char *argv[]);
    1.31  
    1.32  
    1.33 -/* From the SDL library code -- needed for registering the app on Win32 */
    1.34 -#ifdef __WIN32__
    1.35 -
    1.36  #include "begin_code.h"
    1.37  #ifdef __cplusplus
    1.38  /* *INDENT-OFF* */
    1.39 @@ -75,6 +75,8 @@
    1.40  /* *INDENT-ON* */
    1.41  #endif
    1.42  
    1.43 +#ifdef __WIN32__
    1.44 +
    1.45  /**
    1.46   *  This can be called to set the application class at startup
    1.47   */
    1.48 @@ -82,15 +84,15 @@
    1.49                                              void *hInst);
    1.50  extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
    1.51  
    1.52 +#endif /* __WIN32__ */
    1.53 +
    1.54 +
    1.55  #ifdef __cplusplus
    1.56  /* *INDENT-OFF* */
    1.57  }
    1.58  /* *INDENT-ON* */
    1.59  #endif
    1.60  #include "close_code.h"
    1.61 -#endif
    1.62 -
    1.63 -#endif /* Need to redefine main()? */
    1.64  
    1.65  #endif /* _SDL_main_h */
    1.66