This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
SDL_main.h
99 lines (78 loc) · 2.2 KB
1
2
/*
SDL - Simple DirectMedia Layer
3
Copyright (C) 1997-2011 Sam Lantinga
4
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.
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
13
Lesser General Public License for more details.
14
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
18
19
Sam Lantinga
20
slouken@libsdl.org
21
22
23
24
25
*/
#ifndef _SDL_main_h
#define _SDL_main_h
26
27
#include "SDL_stdinc.h"
28
29
30
31
32
/**
* \file SDL_main.h
*
* Redefine main() on some platforms so that it is called by SDL.
*/
33
34
35
36
37
38
#if defined(__WIN32__) || defined(__IPHONEOS__) || defined(__ANDROID__)
#ifndef SDL_MAIN_HANDLED
#define SDL_MAIN_NEEDED
#endif
#endif
39
40
41
42
43
44
45
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif /* __cplusplus */
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* \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
59
*/
60
61
#ifdef SDL_MAIN_NEEDED
62
#define main SDL_main
63
#endif
64
65
66
67
/**
* The prototype for the application's main() function
*/
68
69
70
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
71
#include "begin_code.h"
72
#ifdef __cplusplus
73
/* *INDENT-OFF* */
74
extern "C" {
75
/* *INDENT-ON* */
76
77
#endif
78
79
#ifdef __WIN32__
80
81
82
/**
* This can be called to set the application class at startup
*/
83
84
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
void *hInst);
85
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
86
87
88
89
#endif /* __WIN32__ */
90
#ifdef __cplusplus
91
/* *INDENT-OFF* */
92
}
93
/* *INDENT-ON* */
94
95
96
97
#endif
#include "close_code.h"
#endif /* _SDL_main_h */
98
99
/* vi: set ts=4 sw=4 expandtab: */