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

Latest commit

 

History

History
98 lines (78 loc) · 2.26 KB

SDL_main.h

File metadata and controls

98 lines (78 loc) · 2.26 KB
 
Apr 26, 2001
Apr 26, 2001
1
/*
Apr 8, 2011
Apr 8, 2011
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Apr 26, 2001
Apr 26, 2001
20
21
22
23
24
*/
#ifndef _SDL_main_h
#define _SDL_main_h
Feb 10, 2006
Feb 10, 2006
25
26
#include "SDL_stdinc.h"
Oct 19, 2009
Oct 19, 2009
27
28
29
30
31
/**
* \file SDL_main.h
*
* Redefine main() on some platforms so that it is called by SDL.
*/
Apr 26, 2001
Apr 26, 2001
32
Feb 16, 2011
Feb 16, 2011
33
34
35
36
37
#if defined(__WIN32__) || defined(__IPHONEOS__) || defined(__ANDROID__)
#ifndef SDL_MAIN_HANDLED
#define SDL_MAIN_NEEDED
#endif
#endif
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
Feb 16, 2011
Feb 16, 2011
60
#ifdef SDL_MAIN_NEEDED
Apr 26, 2001
Apr 26, 2001
61
#define main SDL_main
Feb 16, 2011
Feb 16, 2011
62
#endif
Apr 26, 2001
Apr 26, 2001
63
Oct 19, 2009
Oct 19, 2009
64
65
66
/**
* The prototype for the application's main() function
*/
Apr 26, 2001
Apr 26, 2001
67
68
69
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
Feb 10, 2006
Feb 10, 2006
70
#include "begin_code.h"
Apr 26, 2001
Apr 26, 2001
71
#ifdef __cplusplus
Jul 10, 2006
Jul 10, 2006
72
/* *INDENT-OFF* */
Apr 26, 2001
Apr 26, 2001
73
extern "C" {
Jul 10, 2006
Jul 10, 2006
74
/* *INDENT-ON* */
Apr 26, 2001
Apr 26, 2001
75
76
#endif
Feb 16, 2011
Feb 16, 2011
77
78
#ifdef __WIN32__
Oct 19, 2009
Oct 19, 2009
79
80
81
/**
* This can be called to set the application class at startup
*/
Jul 10, 2006
Jul 10, 2006
82
83
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
void *hInst);
Mar 5, 2006
Mar 5, 2006
84
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
Jul 10, 2006
Jul 10, 2006
85
Feb 16, 2011
Feb 16, 2011
86
87
88
#endif /* __WIN32__ */
Apr 26, 2001
Apr 26, 2001
89
#ifdef __cplusplus
Jul 10, 2006
Jul 10, 2006
90
/* *INDENT-OFF* */
Apr 26, 2001
Apr 26, 2001
91
}
Jul 10, 2006
Jul 10, 2006
92
/* *INDENT-ON* */
Apr 26, 2001
Apr 26, 2001
93
94
95
96
#endif
#include "close_code.h"
#endif /* _SDL_main_h */
Jul 10, 2006
Jul 10, 2006
97
98
/* vi: set ts=4 sw=4 expandtab: */