include/SDL_main.h
branchSDL-1.2
changeset 4217 4c4113c2162c
parent 4159 a1b03ba2fcd0
child 6137 4720145f848b
equal deleted inserted replaced
4216:5b99971a27b4 4217:4c4113c2162c
    23 #ifndef _SDL_main_h
    23 #ifndef _SDL_main_h
    24 #define _SDL_main_h
    24 #define _SDL_main_h
    25 
    25 
    26 #include "SDL_stdinc.h"
    26 #include "SDL_stdinc.h"
    27 
    27 
    28 /* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
    28 /** @file SDL_main.h
       
    29  *  Redefine main() on Win32 and MacOS so that it is called by winmain.c
       
    30  */
    29 
    31 
    30 #if defined(__WIN32__) || \
    32 #if defined(__WIN32__) || \
    31     (defined(__MWERKS__) && !defined(__BEOS__)) || \
    33     (defined(__MWERKS__) && !defined(__BEOS__)) || \
    32     defined(__MACOS__) || defined(__MACOSX__) || \
    34     defined(__MACOS__) || defined(__MACOSX__) || \
    33     defined(__SYMBIAN32__) || defined(QWS)
    35     defined(__SYMBIAN32__) || defined(QWS)
    36 #define C_LINKAGE	"C"
    38 #define C_LINKAGE	"C"
    37 #else
    39 #else
    38 #define C_LINKAGE
    40 #define C_LINKAGE
    39 #endif /* __cplusplus */
    41 #endif /* __cplusplus */
    40 
    42 
    41 /* The application's main() function must be called with C linkage,
    43 /** The application's main() function must be called with C linkage,
    42    and should be declared like this:
    44  *  and should be declared like this:
    43 #ifdef __cplusplus
    45  *      @code
    44 extern "C"
    46  *      #ifdef __cplusplus
    45 #endif
    47  *      extern "C"
    46 	int main(int argc, char *argv[])
    48  *      #endif
    47 	{
    49  *	int main(int argc, char *argv[])
    48 	}
    50  *	{
       
    51  *	}
       
    52  *      @endcode
    49  */
    53  */
    50 #define main	SDL_main
    54 #define main	SDL_main
    51 
    55 
    52 /* The prototype for the application's main() function */
    56 /** The prototype for the application's main() function */
    53 extern C_LINKAGE int SDL_main(int argc, char *argv[]);
    57 extern C_LINKAGE int SDL_main(int argc, char *argv[]);
    54 
    58 
    55 
    59 
    56 /* From the SDL library code -- needed for registering the app on Win32 */
    60 /** @name From the SDL library code -- needed for registering the app on Win32 */
       
    61 /*@{*/
    57 #ifdef __WIN32__
    62 #ifdef __WIN32__
    58 
    63 
    59 #include "begin_code.h"
    64 #include "begin_code.h"
    60 #ifdef __cplusplus
    65 #ifdef __cplusplus
    61 extern "C" {
    66 extern "C" {
    62 #endif
    67 #endif
    63 
    68 
    64 /* This should be called from your WinMain() function, if any */
    69 /** This should be called from your WinMain() function, if any */
    65 extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
    70 extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
    66 /* This can also be called, but is no longer necessary */
    71 /** This can also be called, but is no longer necessary */
    67 extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
    72 extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
    68 /* This can also be called, but is no longer necessary (SDL_Quit calls it) */
    73 /** This can also be called, but is no longer necessary (SDL_Quit calls it) */
    69 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
    74 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
    70 #ifdef __cplusplus
    75 #ifdef __cplusplus
    71 }
    76 }
    72 #endif
    77 #endif
    73 #include "close_code.h"
    78 #include "close_code.h"
    74 #endif
    79 #endif
       
    80 /*@}*/
    75 
    81 
    76 /* From the SDL library code -- needed for registering QuickDraw on MacOS */
    82 /** @name From the SDL library code -- needed for registering QuickDraw on MacOS */
       
    83 /*@{*/
    77 #if defined(__MACOS__)
    84 #if defined(__MACOS__)
    78 
    85 
    79 #include "begin_code.h"
    86 #include "begin_code.h"
    80 #ifdef __cplusplus
    87 #ifdef __cplusplus
    81 extern "C" {
    88 extern "C" {
    82 #endif
    89 #endif
    83 
    90 
    84 /* Forward declaration so we don't need to include QuickDraw.h */
    91 /** Forward declaration so we don't need to include QuickDraw.h */
    85 struct QDGlobals;
    92 struct QDGlobals;
    86 
    93 
    87 /* This should be called from your main() function, if any */
    94 /** This should be called from your main() function, if any */
    88 extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
    95 extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
    89 
    96 
    90 #ifdef __cplusplus
    97 #ifdef __cplusplus
    91 }
    98 }
    92 #endif
    99 #endif
    93 #include "close_code.h"
   100 #include "close_code.h"
    94 #endif
   101 #endif
       
   102 /*@}*/
    95 
   103 
    96 #endif /* Need to redefine main()? */
   104 #endif /* Need to redefine main()? */
    97 
   105 
    98 #endif /* _SDL_main_h */
   106 #endif /* _SDL_main_h */