* 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user