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

Latest commit

 

History

History
97 lines (77 loc) · 2.29 KB

SDL_main.h

File metadata and controls

97 lines (77 loc) · 2.29 KB
 
Apr 26, 2001
Apr 26, 2001
1
2
/*
SDL - Simple DirectMedia Layer
Jan 24, 2010
Jan 24, 2010
3
Copyright (C) 1997-2010 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"
Oct 19, 2009
Oct 19, 2009
28
29
30
31
32
/**
* \file SDL_main.h
*
* Redefine main() on some platforms so that it is called by SDL.
*/
Apr 26, 2001
Apr 26, 2001
33
Jan 21, 2011
Jan 21, 2011
34
#if defined(__WINDOWS__) || \
Aug 20, 2002
Aug 20, 2002
35
(defined(__MWERKS__) && !defined(__BEOS__)) || \
Jan 4, 2011
Jan 4, 2011
36
37
defined(__SYMBIAN32__) || defined(__IPHONEOS__) || \
defined(__ANDROID__)
Apr 26, 2001
Apr 26, 2001
38
39
40
41
42
43
44
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif /* __cplusplus */
Oct 19, 2009
Oct 19, 2009
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* \file SDL_main.h
*
* The application's main() function must be called with C linkage,
* and should be declared like this:
* \code
* #ifdef __cplusplus
* extern "C"
* #endif
* int main(int argc, char *argv[])
* {
* }
* \endcode
Apr 26, 2001
Apr 26, 2001
58
*/
Oct 19, 2009
Oct 19, 2009
59
Apr 26, 2001
Apr 26, 2001
60
61
#define main SDL_main
Oct 19, 2009
Oct 19, 2009
62
63
64
/**
* The prototype for the application's main() function
*/
Apr 26, 2001
Apr 26, 2001
65
66
67
68
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
/* From the SDL library code -- needed for registering the app on Win32 */
Jan 21, 2011
Jan 21, 2011
69
#ifdef __WINDOWS__
Apr 26, 2001
Apr 26, 2001
70
Feb 10, 2006
Feb 10, 2006
71
#include "begin_code.h"
Apr 26, 2001
Apr 26, 2001
72
#ifdef __cplusplus
Jul 10, 2006
Jul 10, 2006
73
/* *INDENT-OFF* */
Apr 26, 2001
Apr 26, 2001
74
extern "C" {
Jul 10, 2006
Jul 10, 2006
75
/* *INDENT-ON* */
Apr 26, 2001
Apr 26, 2001
76
77
#endif
Oct 19, 2009
Oct 19, 2009
78
79
80
/**
* This can be called to set the application class at startup
*/
Jul 10, 2006
Jul 10, 2006
81
82
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
void *hInst);
Mar 5, 2006
Mar 5, 2006
83
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
Jul 10, 2006
Jul 10, 2006
84
Apr 26, 2001
Apr 26, 2001
85
#ifdef __cplusplus
Jul 10, 2006
Jul 10, 2006
86
/* *INDENT-OFF* */
Apr 26, 2001
Apr 26, 2001
87
}
Jul 10, 2006
Jul 10, 2006
88
/* *INDENT-ON* */
Apr 26, 2001
Apr 26, 2001
89
90
91
92
93
94
95
#endif
#include "close_code.h"
#endif
#endif /* Need to redefine main()? */
#endif /* _SDL_main_h */
Jul 10, 2006
Jul 10, 2006
96
97
/* vi: set ts=4 sw=4 expandtab: */