From 1a2e57cb9123e35be4f385c8d2e01aae4ac7109e Mon Sep 17 00:00:00 2001 From: Vecais Dumais Laacis Date: Thu, 7 Dec 2006 14:16:31 +0000 Subject: [PATCH] * using SM_main instead of main * added some dummy functions in release mode (getenv, system, _popen, _pclose) which doesnt exist in libc.lib --- stepmania/src/archutils/Xbox/arch_setup.cpp | 30 ++++++++++++++++++--- stepmania/src/archutils/Xbox/arch_setup.h | 3 +++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/stepmania/src/archutils/Xbox/arch_setup.cpp b/stepmania/src/archutils/Xbox/arch_setup.cpp index 3cbe9cc32f..017e1909b5 100644 --- a/stepmania/src/archutils/Xbox/arch_setup.cpp +++ b/stepmania/src/archutils/Xbox/arch_setup.cpp @@ -1,13 +1,37 @@ #include "global.h" -int main( int argc, char* argv[] ); +#undef main void __cdecl main() { int argc = 1; - char *argv[] = {"default.xbe"}; - int ret = main( argc, argv ); + char def[] = "default.xbe"; + char *argv[] = { def }; + int ret=SM_main( argc, argv ); } +#ifndef _DEBUG +//release xbox libs doesnt have these functions +FILE * __cdecl _popen(const char *, const char *) +{ + return NULL; +} + +int __cdecl _pclose(FILE *) +{ + return -1; +} + +char *getenv(const char *) +{ + return NULL; +} + +int __cdecl system(const char *) +{ + return -1; +} +#endif + /* * (c) 2006 Chris * All rights reserved. diff --git a/stepmania/src/archutils/Xbox/arch_setup.h b/stepmania/src/archutils/Xbox/arch_setup.h index 63bb0151bc..d06f54f6d6 100644 --- a/stepmania/src/archutils/Xbox/arch_setup.h +++ b/stepmania/src/archutils/Xbox/arch_setup.h @@ -17,4 +17,7 @@ inline HRESULT CoInitialize( LPVOID pvReserved ) { return S_OK; } inline void CoUninitialize() { } +extern "C" int SM_main( int argc, char *argv[] ); +#define main(x,y) SM_main(x,y) + #endif