00001 /* 00002 SDL - Simple DirectMedia Layer 00003 Copyright (C) 1997-2009 Sam Lantinga 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 Sam Lantinga 00020 slouken@libsdl.org 00021 */ 00022 00023 #ifndef _SDL_main_h 00024 #define _SDL_main_h 00025 00026 #include "SDL_stdinc.h" 00027 00028 /* Redefine main() on some platforms so that it is called by SDL */ 00029 00030 #if defined(__WIN32__) || \ 00031 (defined(__MWERKS__) && !defined(__BEOS__)) || \ 00032 defined(__SYMBIAN32__) || defined(__IPHONEOS__) 00033 00034 #ifdef __cplusplus 00035 #define C_LINKAGE "C" 00036 #else 00037 #define C_LINKAGE 00038 #endif /* __cplusplus */ 00039 00040 /* The application's main() function must be called with C linkage, 00041 and should be declared like this: 00042 #ifdef __cplusplus 00043 extern "C" 00044 #endif 00045 int main(int argc, char *argv[]) 00046 { 00047 } 00048 */ 00049 #define main SDL_main 00050 00051 /* The prototype for the application's main() function */ 00052 extern C_LINKAGE int SDL_main(int argc, char *argv[]); 00053 00054 00055 /* From the SDL library code -- needed for registering the app on Win32 */ 00056 #ifdef __WIN32__ 00057 00058 #include "begin_code.h" 00059 #ifdef __cplusplus 00060 /* *INDENT-OFF* */ 00061 extern "C" { 00062 /* *INDENT-ON* */ 00063 #endif 00064 00065 /* This can be called to set the application class at startup */ 00066 extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, 00067 void *hInst); 00068 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); 00069 00070 #ifdef __cplusplus 00071 /* *INDENT-OFF* */ 00072 } 00073 /* *INDENT-ON* */ 00074 #endif 00075 #include "close_code.h" 00076 #endif 00077 00078 #endif /* Need to redefine main()? */ 00079 00080 #endif /* _SDL_main_h */ 00081 00082 /* vi: set ts=4 sw=4 expandtab: */