This file is part of MXE. See index.html for further information. diff --git a/include/SDL_main.h b/include/SDL_main.h index 7a766d2..59bd201 100644 --- a/include/SDL_main.h +++ b/include/SDL_main.h @@ -72,15 +72,6 @@ extern C_LINKAGE int SDL_main(int argc, char *argv[]); extern "C" { #endif -/* - * This is called by the real SDL main function to let the rest of the - * library know that initialization was done properly. - * - * Calling this yourself without knowing what you're doing can cause - * crashes and hard to diagnose problems with your application. - */ -extern DECLSPEC void SDL_SetMainReady(void); - #ifdef __WIN32__ /** diff --git a/src/SDL.c b/src/SDL.c index f6f3dec..5f28373 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -43,11 +43,6 @@ extern int SDL_HelperWindowDestroy(void); /* The initialized subsystems */ -#ifdef SDL_MAIN_NEEDED -static SDL_bool SDL_MainIsReady = SDL_FALSE; -#else -static SDL_bool SDL_MainIsReady = SDL_TRUE; -#endif static SDL_bool SDL_bInMainQuit = SDL_FALSE; static Uint8 SDL_SubsystemRefCount[ 32 ]; @@ -93,20 +88,9 @@ SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) { return SDL_SubsystemRefCount[subsystem_index] == 1 || SDL_bInMainQuit; } -void -SDL_SetMainReady(void) -{ - SDL_MainIsReady = SDL_TRUE; -} - int SDL_InitSubSystem(Uint32 flags) { - if (!SDL_MainIsReady) { - SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?"); - return -1; - } - #if !SDL_TIMERS_DISABLED SDL_InitTicks(); #endif diff --git a/src/main/android/SDL_android_main.cpp b/src/main/android/SDL_android_main.cpp index 5f3abba..4581e1c 100644 --- a/src/main/android/SDL_android_main.cpp +++ b/src/main/android/SDL_android_main.cpp @@ -20,8 +20,6 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass c /* This interface could expand with ABI negotiation, calbacks, etc. */ SDL_Android_Init(env, cls); - SDL_SetMainReady(); - /* Run the application code! */ int status; char *argv[2]; diff --git a/src/main/psp/SDL_psp_main.c b/src/main/psp/SDL_psp_main.c index 77ef39d..c60e844 100644 --- a/src/main/psp/SDL_psp_main.c +++ b/src/main/psp/SDL_psp_main.c @@ -37,6 +37,8 @@ PSP_MAIN_THREAD_STACK_SIZE, etc. */ +extern int SDL_main(int argc, char *argv[]); + PSP_MODULE_INFO("SDL App", 0, 1, 1); int sdl_psp_exit_callback(int arg1, int arg2, void *common) @@ -73,8 +75,6 @@ int main(int argc, char *argv[]) /* Register sceKernelExitGame() to be called when we exit */ atexit(sceKernelExitGame); - SDL_SetMainReady(); - (void)SDL_main(argc, argv); return 0; } diff --git a/src/main/windows/SDL_windows_main.c b/src/main/windows/SDL_windows_main.c index bea2082..f4f78f6 100644 --- a/src/main/windows/SDL_windows_main.c +++ b/src/main/windows/SDL_windows_main.c @@ -134,8 +134,6 @@ console_main(int argc, char *argv[]) { int status; - SDL_SetMainReady(); - /* Run the application main() code */ status = SDL_main(argc, argv); diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index 3b544db..17b136e 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -37,6 +37,7 @@ #undef main #endif +extern int SDL_main(int argc, char *argv[]); static int forward_argc; static char **forward_argv; static int exit_status; @@ -186,8 +187,6 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, - (void)postFinishLaunch { - SDL_SetMainReady(); - /* run the user's application, passing argc and argv */ SDL_iPhoneSetEventPump(SDL_TRUE); exit_status = SDL_main(forward_argc, forward_argv);