include/SDL_main.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 01 Feb 2006 06:32:25 +0000
changeset 1312 c9b51268668f
parent 1145 d31afac94eff
child 1356 67114343400d
permissions -rw-r--r--
Updated copyright information and removed rcs id lines (problematic in branch merges)
I batch edited these files, so please let me know if I've accidentally removed anybody's
credit here.
     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     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 #ifndef _SDL_main_h
    24 #define _SDL_main_h
    25 
    26 /* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
    27 
    28 #if defined(WIN32) || defined(_WIN32) || \
    29     (defined(__MWERKS__) && !defined(__BEOS__)) || \
    30     defined(macintosh) || defined(__APPLE__) || \
    31     defined(__SYMBIAN32__) || defined(QWS)
    32 
    33 #ifdef __cplusplus
    34 #define C_LINKAGE	"C"
    35 #else
    36 #define C_LINKAGE
    37 #endif /* __cplusplus */
    38 
    39 /* The application's main() function must be called with C linkage,
    40    and should be declared like this:
    41 #ifdef __cplusplus
    42 extern "C"
    43 #endif
    44 	int main(int argc, char *argv[])
    45 	{
    46 	}
    47  */
    48 #define main	SDL_main
    49 
    50 /* The prototype for the application's main() function */
    51 extern C_LINKAGE int SDL_main(int argc, char *argv[]);
    52 
    53 
    54 /* From the SDL library code -- needed for registering the app on Win32 */
    55 #if defined(WIN32)
    56 #include "SDL_types.h"
    57 #include "begin_code.h"
    58 
    59 #ifdef __cplusplus
    60 extern "C" {
    61 #endif
    62 
    63 /* This should be called from your WinMain() function, if any */
    64 extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
    65 /* This can also be called, but is no longer necessary */
    66 extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
    67 /* This can also be called, but is no longer necessary (SDL_Quit calls it) */
    68 extern DECLSPEC void SDLCALL SDL_UnregisterApp();
    69 #ifdef __cplusplus
    70 }
    71 #endif
    72 #include "close_code.h"
    73 #endif
    74 
    75 /* From the SDL library code -- needed for registering QuickDraw on MacOS */
    76 #if defined(macintosh)
    77 #include "begin_code.h"
    78 
    79 #ifdef __cplusplus
    80 extern "C" {
    81 #endif
    82 
    83 /* Forward declaration so we don't need to include QuickDraw.h */
    84 struct QDGlobals;
    85 
    86 /* This should be called from your main() function, if any */
    87 extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
    88 
    89 #ifdef __cplusplus
    90 }
    91 #endif
    92 #include "close_code.h"
    93 #endif
    94 
    95 #endif /* Need to redefine main()? */
    96 
    97 #endif /* _SDL_main_h */