int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // All we do here is call the real main function after setting up our se translator // this allows us to catch exceptions and report errors to Steam. // // Note that you must set your compiler flags correctly to enable structured exception // handling in order for this particular setup method to work. if ( IsDebuggerPresent() ) { // We don't want to mask exceptions (or report them to Steam!) when debugging. // If you would like to step through the exception handler, attach a debugger // after running the game outside of the debugger. return RealMain( lpCmdLine, hInstance, nCmdShow ); } _set_se_translator( MiniDumpFunction ); try // this try block allows the SE translator to work { return RealMain( lpCmdLine, hInstance, nCmdShow ); } catch( ... ) { return -1; } }
int main(int argc, const char **argv) { char szCmdLine[1024]; char *pszStart = szCmdLine; char * const pszEnd = szCmdLine + Q_ARRAYSIZE(szCmdLine); *szCmdLine = '\0'; for ( int i = 1; i < argc; i++ ) { const char *parm = argv[i]; while ( *parm && (pszStart < pszEnd) ) { *pszStart++ = *parm++; } if ( pszStart >= pszEnd ) break; if ( i < argc-1 ) *pszStart++ = ' '; } szCmdLine[Q_ARRAYSIZE(szCmdLine) - 1] = '\0'; return RealMain( szCmdLine, 0, 0 ); }
int main ( int argc, ///< Number of command line arguments. char **argv ///< Array of command line arguments. ) { int rc = RealMain( argc, argv ); if ( IsDebuggerPresent() ) { printf( "\nPress RETURN to exit\n" ); getchar(); } return rc; }