X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Fbuildfiles%2Fosx%2FXonotic.app%2FContents%2FFrameworks%2FSDL2.framework%2FVersions%2FA%2FHeaders%2FSDL_main.h;h=623f2d005bf29e34c7d8ed45d5062e7bad99fb3a;hp=67afea5e70f8108e0128a877630d812e04570af1;hb=1e434bee7af23e6dfd2130a8eadd131e5da3d643;hpb=c40448285437999d5a83a3c9adb62c58ba8640bc diff --git a/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL2.framework/Versions/A/Headers/SDL_main.h b/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL2.framework/Versions/A/Headers/SDL_main.h index 67afea5e..623f2d00 100644 --- a/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL2.framework/Versions/A/Headers/SDL_main.h +++ b/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL2.framework/Versions/A/Headers/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga + Copyright (C) 1997-2019 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,8 +19,8 @@ 3. This notice may not be removed or altered from any source distribution. */ -#ifndef _SDL_main_h -#define _SDL_main_h +#ifndef SDL_main_h_ +#define SDL_main_h_ #include "SDL_stdinc.h" @@ -55,6 +55,10 @@ /* On iOS SDL provides a main function that creates an application delegate and starts the iOS application run loop. + If you link with SDL dynamically on iOS, the main function can't be in a + shared library, so you need to link with libSDLmain.a, which includes a + stub main function that calls into the shared library to start execution. + See src/video/uikit/SDL_uikitappdelegate.m for more details. */ #define SDL_MAIN_NEEDED @@ -63,10 +67,13 @@ /* On Android SDL provides a Java class in SDLActivity.java that is the main activity entry point. - See README-android.md for more details on extending that class. + See docs/README-android.md for more details on extending that class. */ #define SDL_MAIN_NEEDED +/* We need to export SDL_main so it can be launched from Java */ +#define SDLMAIN_DECLSPEC DECLSPEC + #elif defined(__NACL__) /* On NACL we use ppapi_simple to set up the application helper code, then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before @@ -79,11 +86,9 @@ #endif #endif /* SDL_MAIN_HANDLED */ -#ifdef __cplusplus -#define C_LINKAGE "C" -#else -#define C_LINKAGE -#endif /* __cplusplus */ +#ifndef SDLMAIN_DECLSPEC +#define SDLMAIN_DECLSPEC +#endif /** * \file SDL_main.h @@ -104,17 +109,18 @@ #define main SDL_main #endif -/** - * The prototype for the application's main() function - */ -extern C_LINKAGE int SDL_main(int argc, char *argv[]); - - #include "begin_code.h" #ifdef __cplusplus extern "C" { #endif +/** + * The prototype for the application's main() function + */ +typedef int (*SDL_main_func)(int argc, char *argv[]); +extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); + + /** * This is called by the real SDL main function to let the rest of the * library know that initialization was done properly. @@ -129,8 +135,7 @@ extern DECLSPEC void SDLCALL SDL_SetMainReady(void); /** * This can be called to set the application class at startup */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, - void *hInst); +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); #endif /* __WIN32__ */ @@ -146,16 +151,30 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more * information on the failure. */ -extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * reserved); +extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); #endif /* __WINRT__ */ +#if defined(__IPHONEOS__) + +/** + * \brief Initializes and launches an SDL application. + * + * \param argc The argc parameter from the application's main() function + * \param argv The argv parameter from the application's main() function + * \param mainFunction The SDL app's C-style main(). + * \return the return value from mainFunction + */ +extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); + +#endif /* __IPHONEOS__ */ + #ifdef __cplusplus } #endif #include "close_code.h" -#endif /* _SDL_main_h */ +#endif /* SDL_main_h_ */ /* vi: set ts=4 sw=4 expandtab: */