This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
SDL_main.h
107 lines (83 loc) · 2.7 KB
1
2
/*
SDL - Simple DirectMedia Layer
3
Copyright (C) 1997-2006 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.
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
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
30
#if defined(__WIN32__) || \
31
(defined(__MWERKS__) && !defined(__BEOS__)) || \
32
defined(__MACOS__) || defined(__MACOSX__) || \
33
defined(__SYMBIAN32__) || defined(QWS)
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 */
53
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
54
55
56
/* From the SDL library code -- needed for registering the app on Win32 */
57
#ifdef __WIN32__
59
#include "begin_code.h"
60
#ifdef __cplusplus
61
/* *INDENT-OFF* */
62
extern "C" {
63
/* *INDENT-ON* */
64
65
#endif
66
/* This can be called to set the application class at startup */
67
68
69
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
void *hInst);
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
71
#ifdef __cplusplus
72
/* *INDENT-OFF* */
74
/* *INDENT-ON* */
75
76
77
78
79
#endif
#include "close_code.h"
#endif
/* From the SDL library code -- needed for registering QuickDraw on MacOS */
80
#if defined(__MACOS__)
82
#include "begin_code.h"
83
#ifdef __cplusplus
84
/* *INDENT-OFF* */
85
extern "C" {
86
/* *INDENT-ON* */
87
88
89
90
91
92
#endif
/* Forward declaration so we don't need to include QuickDraw.h */
struct QDGlobals;
/* This should be called from your main() function, if any */
93
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
94
95
#ifdef __cplusplus
96
/* *INDENT-OFF* */
98
/* *INDENT-ON* */
99
100
101
102
103
104
105
#endif
#include "close_code.h"
#endif
#endif /* Need to redefine main()? */
#endif /* _SDL_main_h */
106
107
/* vi: set ts=4 sw=4 expandtab: */