From 587431f8e838bd08d081d65f18b1f9b8f04566b8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 2 Apr 2006 00:08:22 +0000 Subject: Fully and officially renamed our main function to scummvm_main, thus making various backend specific hacks unnecessary. As a consequence, it is now the responsibility of the backend to define main. Hence I adapted the SDL backend accordingly. svn-id: r21542 --- backends/dc/dcmain.cpp | 5 +---- backends/dc/portdefs.h | 3 --- backends/gp32/gp32_main.cpp | 4 ++-- backends/maemo/main.cpp | 4 +--- backends/maemo/portdefs.h | 6 ------ backends/morphos/morphos.h | 2 -- backends/morphos/morphos_start.cpp | 3 ++- backends/ps2/systemps2.cpp | 3 +-- backends/psp/portdefs.h | 6 ------ backends/psp/psp_main.cpp | 4 +--- backends/sdl/sdl.cpp | 7 +++++++ backends/wince/wince-sdl.cpp | 3 +-- 12 files changed, 16 insertions(+), 34 deletions(-) (limited to 'backends') diff --git a/backends/dc/dcmain.cpp b/backends/dc/dcmain.cpp index 0955836bdd..d622c35019 100644 --- a/backends/dc/dcmain.cpp +++ b/backends/dc/dcmain.cpp @@ -21,13 +21,11 @@ * */ - -#define REAL_MAIN - #include #include #include #include +#include #include #include "dc.h" #include "icon.h" @@ -205,7 +203,6 @@ void dc_init_hardware() init_arm(); } -extern "C" int scummvm_main(int argc, char *argv[]); int main() { static char *argv[] = { "scummvm", NULL, }; diff --git a/backends/dc/portdefs.h b/backends/dc/portdefs.h index 1217810ef5..cedfd5c0fe 100644 --- a/backends/dc/portdefs.h +++ b/backends/dc/portdefs.h @@ -37,6 +37,3 @@ #ifdef Timer #undef Timer #endif -#ifndef REAL_MAIN -#define main scummvm_main -#endif diff --git a/backends/gp32/gp32_main.cpp b/backends/gp32/gp32_main.cpp index cf636fdba4..8abdb4a7ce 100644 --- a/backends/gp32/gp32_main.cpp +++ b/backends/gp32/gp32_main.cpp @@ -26,6 +26,8 @@ #include "common/config-manager.h" +#include "base/main.h" + #include "backends/gp32/gp32std.h" #include "backends/gp32/gp32std_grap.h" @@ -34,8 +36,6 @@ GlobalVars g_vars; -extern "C" int scummvm_main(int argc, char *argv[]); - void init() { gp_setCpuSpeed(40); // Default CPU Speed diff --git a/backends/maemo/main.cpp b/backends/maemo/main.cpp index 7ef2bfd2f1..231f319158 100644 --- a/backends/maemo/main.cpp +++ b/backends/maemo/main.cpp @@ -20,7 +20,6 @@ * */ -#define REAL_MAIN #include #include #include @@ -29,6 +28,7 @@ #include #include +#include "base/main.h" #include #include #include @@ -48,8 +48,6 @@ void set_doubling(unsigned char enable) { XSPSetPixelDoubling(wminfo.info.x11.display, 0, enable); } -extern "C" int scummvm_main(int argc, char *argv[]); - int main(int argc, char *argv[]) { osso_context_t *osso_context; diff --git a/backends/maemo/portdefs.h b/backends/maemo/portdefs.h index 82894331b3..f825e5c4e2 100644 --- a/backends/maemo/portdefs.h +++ b/backends/maemo/portdefs.h @@ -52,12 +52,6 @@ typedef signed int int32; /* Whether we should use i386 assembly routines */ #undef USE_NASM -#undef main - -#ifndef REAL_MAIN -#define main scummvm_main -#endif - #include #include #include diff --git a/backends/morphos/morphos.h b/backends/morphos/morphos.h index 46d35689c0..7f919f7080 100644 --- a/backends/morphos/morphos.h +++ b/backends/morphos/morphos.h @@ -226,8 +226,6 @@ class AutoLock #define AUTO_LOCK AutoLock cs(&CritSec); -int morphos_main(int argc, char *argv[]); - extern OSystem_MorphOS *TheSystem; #endif diff --git a/backends/morphos/morphos_start.cpp b/backends/morphos/morphos_start.cpp index f19a96983e..f7ec56f224 100644 --- a/backends/morphos/morphos_start.cpp +++ b/backends/morphos/morphos_start.cpp @@ -37,6 +37,7 @@ #include "common/stdafx.h" #include "scumm/scumm.h" #include "base/gameDetector.h" +#include "base/main.h" #include "common/scaler.h" #include "sound/mididrv.h" #include "morphos.h" @@ -433,6 +434,6 @@ int main() if (ScummStory) argv[argc++] = ScummStory; - return morphos_main(argc, argv); + return scummvm_main(argc, argv); } diff --git a/backends/ps2/systemps2.cpp b/backends/ps2/systemps2.cpp index 7262000986..d0154ab590 100644 --- a/backends/ps2/systemps2.cpp +++ b/backends/ps2/systemps2.cpp @@ -35,6 +35,7 @@ #include "common/scummsys.h" #include "../intern.h" #include "base/engine.h" +#include "base/main.h" #include "backends/ps2/systemps2.h" #include "backends/ps2/Gs2dScreen.h" #include "backends/ps2/ps2input.h" @@ -98,8 +99,6 @@ OSystem *OSystem_PS2_create(void) { return g_systemPs2; } -extern "C" int scummvm_main(int argc, char *argv[]); - extern "C" int main(int argc, char *argv[]) { SifInitRpc(0); #ifndef USE_PS2LINK // reset the IOP if this is a CD build diff --git a/backends/psp/portdefs.h b/backends/psp/portdefs.h index 558b218f90..a63c8ff39e 100644 --- a/backends/psp/portdefs.h +++ b/backends/psp/portdefs.h @@ -51,12 +51,6 @@ //#define printf pspDebugScreenPrintf #define exit(x) printf("exit() called\n"); sceKernelSleepThread(); -#undef main - -#ifndef REAL_MAIN -#define main scummvm_main -#endif - #endif /* PORTDEFS_H */ diff --git a/backends/psp/psp_main.cpp b/backends/psp/psp_main.cpp index b4af6dbbe7..d981c314dc 100644 --- a/backends/psp/psp_main.cpp +++ b/backends/psp/psp_main.cpp @@ -28,10 +28,10 @@ #include #include -#define REAL_MAIN #include #include #include +#include #include #include @@ -123,8 +123,6 @@ int SetupCallbacks(void) } -extern "C" int scummvm_main(int argc, char *argv[]); - int main(void) { //PSPDebugTrace("Init debug screen\n"); diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 74dbb969e9..b1da08c60e 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -24,6 +24,7 @@ #include "backends/sdl/sdl-common.h" #include "common/config-manager.h" #include "common/util.h" +#include "base/main.h" #if defined(HAVE_CONFIG_H) #include "config.h" @@ -32,6 +33,12 @@ #include "scummvm.xpm" +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && !defined(__MAEMO__) +int main(int argc, char *argv[]) { + return scummvm_main(argc, argv); +} +#endif + OSystem *OSystem_SDL_create() { return new OSystem_SDL(); } diff --git a/backends/wince/wince-sdl.cpp b/backends/wince/wince-sdl.cpp index f8150d6f2c..46c95f9ed5 100644 --- a/backends/wince/wince-sdl.cpp +++ b/backends/wince/wince-sdl.cpp @@ -26,6 +26,7 @@ #include "common/util.h" #include "base/gameDetector.h" #include "base/engine.h" +#include "base/main.h" #include "base/plugins.h" #include "common/timer.h" @@ -119,8 +120,6 @@ bool isSmartphone() { // MAIN -extern "C" int scummvm_main(GameDetector &gameDetector, int argc, char **argv); - int handleException(EXCEPTION_POINTERS *exceptionPointers) { CEException::writeException(TEXT("\\scummvmCrash"), exceptionPointers); drawError("Unrecoverable exception occurred - see crash dump in latest \\scummvmCrash file"); -- cgit v1.2.3