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

Latest commit

 

History

History
109 lines (86 loc) · 2.89 KB

SDL_main.h

File metadata and controls

109 lines (86 loc) · 2.89 KB
 
Apr 26, 2001
Apr 26, 2001
1
2
/*
SDL - Simple DirectMedia Layer
Feb 1, 2006
Feb 1, 2006
3
Copyright (C) 1997-2006 Sam Lantinga
Apr 26, 2001
Apr 26, 2001
4
5
This library is free software; you can redistribute it and/or
Feb 1, 2006
Feb 1, 2006
6
modify it under the terms of the GNU Lesser General Public
Apr 26, 2001
Apr 26, 2001
7
License as published by the Free Software Foundation; either
Feb 1, 2006
Feb 1, 2006
8
version 2.1 of the License, or (at your option) any later version.
Apr 26, 2001
Apr 26, 2001
9
10
11
12
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Feb 1, 2006
Feb 1, 2006
13
Lesser General Public License for more details.
Apr 26, 2001
Apr 26, 2001
14
Feb 1, 2006
Feb 1, 2006
15
16
17
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Apr 26, 2001
Apr 26, 2001
18
19
Sam Lantinga
Dec 14, 2001
Dec 14, 2001
20
slouken@libsdl.org
Apr 26, 2001
Apr 26, 2001
21
22
23
24
25
*/
#ifndef _SDL_main_h
#define _SDL_main_h
Feb 10, 2006
Feb 10, 2006
26
27
#include "SDL_stdinc.h"
Apr 26, 2001
Apr 26, 2001
28
29
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
Feb 21, 2006
Feb 21, 2006
30
#if defined(__WIN32__) || \
Aug 20, 2002
Aug 20, 2002
31
(defined(__MWERKS__) && !defined(__BEOS__)) || \
Feb 21, 2006
Feb 21, 2006
32
defined(__MACOS__) || defined(__MACOSX__) || \
Aug 20, 2002
Aug 20, 2002
33
defined(__SYMBIAN32__) || defined(QWS)
Apr 26, 2001
Apr 26, 2001
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif /* __cplusplus */
/* The application's main() function must be called with C linkage,
and should be declared like this:
#ifdef __cplusplus
extern "C"
#endif
int main(int argc, char *argv[])
{
}
*/
#define main SDL_main
/* The prototype for the application's main() function */
May 29, 2006
May 29, 2006
53
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
Apr 26, 2001
Apr 26, 2001
54
55
56
/* From the SDL library code -- needed for registering the app on Win32 */
Feb 21, 2006
Feb 21, 2006
57
#ifdef __WIN32__
Apr 26, 2001
Apr 26, 2001
58
Feb 10, 2006
Feb 10, 2006
59
#include "begin_code.h"
Apr 26, 2001
Apr 26, 2001
60
#ifdef __cplusplus
May 28, 2006
May 28, 2006
61
/* *INDENT-OFF* */
Apr 26, 2001
Apr 26, 2001
62
extern "C" {
May 28, 2006
May 28, 2006
63
/* *INDENT-ON* */
Apr 26, 2001
Apr 26, 2001
64
65
66
#endif
/* This should be called from your WinMain() function, if any */
May 29, 2006
May 29, 2006
67
extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
Aug 9, 2001
Aug 9, 2001
68
/* This can also be called, but is no longer necessary */
May 29, 2006
May 29, 2006
69
70
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
void *hInst);
Sep 27, 2005
Sep 27, 2005
71
/* This can also be called, but is no longer necessary (SDL_Quit calls it) */
May 29, 2006
May 29, 2006
72
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
Apr 26, 2001
Apr 26, 2001
73
#ifdef __cplusplus
May 28, 2006
May 28, 2006
74
/* *INDENT-OFF* */
Apr 26, 2001
Apr 26, 2001
75
}
May 28, 2006
May 28, 2006
76
/* *INDENT-ON* */
Apr 26, 2001
Apr 26, 2001
77
78
79
80
81
#endif
#include "close_code.h"
#endif
/* From the SDL library code -- needed for registering QuickDraw on MacOS */
Feb 21, 2006
Feb 21, 2006
82
#if defined(__MACOS__)
Apr 26, 2001
Apr 26, 2001
83
Feb 10, 2006
Feb 10, 2006
84
#include "begin_code.h"
Apr 26, 2001
Apr 26, 2001
85
#ifdef __cplusplus
May 28, 2006
May 28, 2006
86
/* *INDENT-OFF* */
Apr 26, 2001
Apr 26, 2001
87
extern "C" {
May 28, 2006
May 28, 2006
88
/* *INDENT-ON* */
Apr 26, 2001
Apr 26, 2001
89
90
91
92
93
94
#endif
/* Forward declaration so we don't need to include QuickDraw.h */
struct QDGlobals;
/* This should be called from your main() function, if any */
May 29, 2006
May 29, 2006
95
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
Apr 26, 2001
Apr 26, 2001
96
97
#ifdef __cplusplus
May 28, 2006
May 28, 2006
98
/* *INDENT-OFF* */
Apr 26, 2001
Apr 26, 2001
99
}
May 28, 2006
May 28, 2006
100
/* *INDENT-ON* */
Apr 26, 2001
Apr 26, 2001
101
102
103
104
105
106
107
#endif
#include "close_code.h"
#endif
#endif /* Need to redefine main()? */
#endif /* _SDL_main_h */
May 28, 2006
May 28, 2006
108
109
/* vi: set ts=4 sw=4 expandtab: */