- commandline bugfixes for windows

This commit is contained in:
Mark Vejvoda
2010-08-22 09:06:26 +00:00
parent 607132ac80
commit 0c0642bd17
2 changed files with 5 additions and 5 deletions

View File

@@ -424,7 +424,7 @@ void MainWindow::setProgram(Program *program) {
// ===================================================== // =====================================================
SystemFlags debugger; SystemFlags debugger;
bool hasCommandArgument(int argc, const char** argv,const string argName, int *foundIndex=NULL, int startLookupIndex=1,bool useArgParamLen=false) { bool hasCommandArgument(int argc, char** argv,const string argName, int *foundIndex=NULL, int startLookupIndex=1,bool useArgParamLen=false) {
bool result = false; bool result = false;
if(foundIndex != NULL) { if(foundIndex != NULL) {
@@ -448,7 +448,7 @@ bool hasCommandArgument(int argc, const char** argv,const string argName, int *f
return result; return result;
} }
int glestMain(int argc, const char** argv){ int glestMain(int argc, char** argv){
#ifdef SL_LEAK_DUMP #ifdef SL_LEAK_DUMP
AllocRegistry memoryLeaks = AllocRegistry::getInstance(); AllocRegistry memoryLeaks = AllocRegistry::getInstance();
@@ -457,7 +457,7 @@ int glestMain(int argc, const char** argv){
bool foundInvalidArgs = false; bool foundInvalidArgs = false;
const int knownArgCount = sizeof(GAME_ARGS) / sizeof(GAME_ARGS[0]); const int knownArgCount = sizeof(GAME_ARGS) / sizeof(GAME_ARGS[0]);
for(int idx = 1; idx < argc; ++idx) { for(int idx = 1; idx < argc; ++idx) {
if( hasCommandArgument(knownArgCount, GAME_ARGS,argv[idx],NULL,0,true) == false) { if( hasCommandArgument(knownArgCount, (char **)&GAME_ARGS[0], argv[idx], NULL, 0, true) == false) {
foundInvalidArgs = true; foundInvalidArgs = true;
printf("\nInvalid argument: %s",argv[idx]); printf("\nInvalid argument: %s",argv[idx]);
} }

View File

@@ -14,8 +14,8 @@
#include <SDL.h> #include <SDL.h>
#include <iostream> #include <iostream>
#define MAIN_FUNCTION(X) int main(int argc, const char **argv) \ #define MAIN_FUNCTION(X) int main(int argc, char **argv) \
{ \ { \
if(SDL_Init(SDL_INIT_EVERYTHING) < 0) { \ if(SDL_Init(SDL_INIT_EVERYTHING) < 0) { \
std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; \ std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; \
return 1; \ return 1; \