include/SDL_main.h
changeset 0 74212992fb08
child 47 45b1c4303f87
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_main.h	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,97 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Library General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Library General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Library General Public
    1.19 +    License along with this library; if not, write to the Free
    1.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@devolution.com
    1.24 +*/
    1.25 +
    1.26 +#ifdef SAVE_RCSID
    1.27 +static char rcsid =
    1.28 + "@(#) $Id$";
    1.29 +#endif
    1.30 +
    1.31 +#ifndef _SDL_main_h
    1.32 +#define _SDL_main_h
    1.33 +
    1.34 +/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
    1.35 +
    1.36 +#if defined(WIN32) || (defined(__MWERKS__) && !defined(__BEOS__)) || \
    1.37 +    defined(macintosh)
    1.38 +
    1.39 +#ifdef __cplusplus
    1.40 +#define C_LINKAGE	"C"
    1.41 +#else
    1.42 +#define C_LINKAGE
    1.43 +#endif /* __cplusplus */
    1.44 +
    1.45 +/* The application's main() function must be called with C linkage,
    1.46 +   and should be declared like this:
    1.47 +#ifdef __cplusplus
    1.48 +extern "C"
    1.49 +#endif
    1.50 +	int main(int argc, char *argv[])
    1.51 +	{
    1.52 +	}
    1.53 + */
    1.54 +#define main	SDL_main
    1.55 +
    1.56 +/* The prototype for the application's main() function */
    1.57 +extern C_LINKAGE int SDL_main(int argc, char *argv[]);
    1.58 +
    1.59 +
    1.60 +/* From the SDL library code -- needed for registering the app on Win32 */
    1.61 +#if defined(WIN32)
    1.62 +#include "SDL_types.h"
    1.63 +#include "begin_code.h"
    1.64 +
    1.65 +#ifdef __cplusplus
    1.66 +extern "C" {
    1.67 +#endif
    1.68 +
    1.69 +/* This should be called from your WinMain() function, if any */
    1.70 +extern DECLSPEC int SDL_RegisterApp(char *name, Uint32 style, void *hInst);
    1.71 +
    1.72 +#ifdef __cplusplus
    1.73 +}
    1.74 +#endif
    1.75 +#include "close_code.h"
    1.76 +#endif
    1.77 +
    1.78 +/* From the SDL library code -- needed for registering QuickDraw on MacOS */
    1.79 +#if defined(macintosh)
    1.80 +#include "begin_code.h"
    1.81 +
    1.82 +#ifdef __cplusplus
    1.83 +extern "C" {
    1.84 +#endif
    1.85 +
    1.86 +/* Forward declaration so we don't need to include QuickDraw.h */
    1.87 +struct QDGlobals;
    1.88 +
    1.89 +/* This should be called from your main() function, if any */
    1.90 +extern DECLSPEC void SDL_InitQuickDraw(struct QDGlobals *the_qd);
    1.91 +
    1.92 +#ifdef __cplusplus
    1.93 +}
    1.94 +#endif
    1.95 +#include "close_code.h"
    1.96 +#endif
    1.97 +
    1.98 +#endif /* Need to redefine main()? */
    1.99 +
   1.100 +#endif /* _SDL_main_h */