Initial sauer
[SauerbratenRemote.git] / src / include / SDL_main.h
blob87f3447ede4d293a468595399bab91c110111e2a
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2006 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 Sam Lantinga
20 slouken@libsdl.org
23 #ifndef _SDL_main_h
24 #define _SDL_main_h
26 #include "SDL_stdinc.h"
28 /* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
30 #if defined(__WIN32__) || \
31 (defined(__MWERKS__) && !defined(__BEOS__)) || \
32 defined(__MACOS__) || defined(__MACOSX__) || \
33 defined(__SYMBIAN32__) || defined(QWS)
35 #ifdef __cplusplus
36 #define C_LINKAGE "C"
37 #else
38 #define C_LINKAGE
39 #endif /* __cplusplus */
41 /* The application's main() function must be called with C linkage,
42 and should be declared like this:
43 #ifdef __cplusplus
44 extern "C"
45 #endif
46 int main(int argc, char *argv[])
50 #define main SDL_main
52 /* The prototype for the application's main() function */
53 extern C_LINKAGE int SDL_main(int argc, char *argv[]);
56 /* From the SDL library code -- needed for registering the app on Win32 */
57 #ifdef __WIN32__
59 #include "begin_code.h"
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
64 /* This should be called from your WinMain() function, if any */
65 extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
66 /* This can also be called, but is no longer necessary */
67 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) */
69 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
70 #ifdef __cplusplus
72 #endif
73 #include "close_code.h"
74 #endif
76 /* From the SDL library code -- needed for registering QuickDraw on MacOS */
77 #if defined(__MACOS__)
79 #include "begin_code.h"
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
84 /* Forward declaration so we don't need to include QuickDraw.h */
85 struct QDGlobals;
87 /* This should be called from your main() function, if any */
88 extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
90 #ifdef __cplusplus
92 #endif
93 #include "close_code.h"
94 #endif
96 #endif /* Need to redefine main()? */
98 #endif /* _SDL_main_h */