* using SM_main instead of main

* added some dummy functions in release mode (getenv, system, _popen, _pclose) which doesnt exist in libc.lib
This commit is contained in:
Vecais Dumais Laacis
2006-12-07 14:16:31 +00:00
parent 172033715f
commit 1a2e57cb91
2 changed files with 30 additions and 3 deletions
+27 -3
View File
@@ -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.
@@ -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