Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Allow you to override SDL's main override
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 16, 2011
1 parent 0b4d50d commit be278c4
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions include/SDL_main.h
Expand Up @@ -31,10 +31,11 @@
* Redefine main() on some platforms so that it is called by SDL.
*/

#if defined(__WIN32__) || \
(defined(__MWERKS__) && !defined(__BEOS__)) || \
defined(__SYMBIAN32__) || defined(__IPHONEOS__) || \
defined(__ANDROID__)
#if defined(__WIN32__) || defined(__IPHONEOS__) || defined(__ANDROID__)
#ifndef SDL_MAIN_HANDLED
#define SDL_MAIN_NEEDED
#endif
#endif

#ifdef __cplusplus
#define C_LINKAGE "C"
Expand All @@ -57,40 +58,41 @@
* \endcode
*/

#ifdef SDL_MAIN_NEEDED
#define main SDL_main
#endif

/**
* The prototype for the application's main() function
*/
extern C_LINKAGE int SDL_main(int argc, char *argv[]);


/* From the SDL library code -- needed for registering the app on Win32 */
#ifdef __WIN32__

#include "begin_code.h"
#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif

#ifdef __WIN32__

/**
* This can be called to set the application class at startup
*/
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
void *hInst);
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);

#endif /* __WIN32__ */


#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif

#endif /* Need to redefine main()? */

#endif /* _SDL_main_h */

Expand Down

0 comments on commit be278c4

Please sign in to comment.