Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5496 | leency | 1 | /* |
2 | SDL - Simple DirectMedia Layer |
||
3 | Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
||
4 | |||
5 | This library is free software; you can redistribute it and/or |
||
6 | modify it under the terms of the GNU Library General Public |
||
7 | License as published by the Free Software Foundation; either |
||
8 | version 2 of the License, or (at your option) any later version. |
||
9 | |||
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 | Library General Public License for more details. |
||
14 | |||
15 | You should have received a copy of the GNU Library General Public |
||
16 | License along with this library; if not, write to the Free |
||
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
18 | |||
19 | Sam Lantinga |
||
20 | slouken@devolution.com |
||
21 | */ |
||
22 | |||
23 | #ifdef SAVE_RCSID |
||
24 | static char rcsid = |
||
25 | "@(#) $Id: SDL_main.h,v 1.3 2001/06/07 14:28:11 hercules Exp $"; |
||
26 | #endif |
||
27 | |||
28 | #ifndef _SDL_main_h |
||
29 | #define _SDL_main_h |
||
30 | |||
31 | /* Redefine main() on Win32 and MacOS so that it is called by winmain.c */ |
||
32 | |||
33 | #if defined(WIN32) || (defined(__MWERKS__) && !defined(__BEOS__)) || \ |
||
34 | defined(macintosh) || defined(__APPLE__) |
||
35 | |||
36 | #ifdef __cplusplus |
||
37 | #define C_LINKAGE "C" |
||
38 | #else |
||
39 | #define C_LINKAGE |
||
40 | #endif /* __cplusplus */ |
||
41 | |||
42 | /* The application's main() function must be called with C linkage, |
||
43 | and should be declared like this: |
||
44 | #ifdef __cplusplus |
||
45 | extern "C" |
||
46 | #endif |
||
47 | int main(int argc, char *argv[]) |
||
48 | { |
||
49 | } |
||
50 | */ |
||
51 | #define main SDL_main |
||
52 | |||
53 | /* The prototype for the application's main() function */ |
||
54 | extern C_LINKAGE int SDL_main(int argc, char *argv[]); |
||
55 | |||
56 | |||
57 | /* From the SDL library code -- needed for registering the app on Win32 */ |
||
58 | #if defined(WIN32) |
||
59 | #include "SDL_types.h" |
||
60 | #include "begin_code.h" |
||
61 | |||
62 | #ifdef __cplusplus |
||
63 | extern "C" { |
||
64 | #endif |
||
65 | |||
66 | /* This should be called from your WinMain() function, if any */ |
||
67 | extern DECLSPEC int SDL_RegisterApp(char *name, Uint32 style, void *hInst); |
||
68 | |||
69 | #ifdef __cplusplus |
||
70 | } |
||
71 | #endif |
||
72 | #include "close_code.h" |
||
73 | #endif |
||
74 | |||
75 | /* From the SDL library code -- needed for registering QuickDraw on MacOS */ |
||
76 | #if defined(macintosh) |
||
77 | #include "begin_code.h" |
||
78 | |||
79 | #ifdef __cplusplus |
||
80 | extern "C" { |
||
81 | #endif |
||
82 | |||
83 | /* Forward declaration so we don't need to include QuickDraw.h */ |
||
84 | struct QDGlobals; |
||
85 | |||
86 | /* This should be called from your main() function, if any */ |
||
87 | extern DECLSPEC void SDL_InitQuickDraw(struct QDGlobals *the_qd); |
||
88 | |||
89 | #ifdef __cplusplus |
||
90 | } |
||
91 | #endif |
||
92 | #include "close_code.h" |
||
93 | #endif |
||
94 | |||
95 | #endif /* Need to redefine main()? */ |
||
96 | |||
97 | #endif /* _SDL_main_h */ |