# HG changeset patch # User elrood # Date 1217361145 -7200 # Node ID ecf70fe065b9bbbb30e31f55f3120174251ad94f # Parent 3dd9ae9ea708e421f7402590415d88e519d0ffcf fixed configuration file loading issues on windows diff -r 3dd9ae9ea708 -r ecf70fe065b9 bin/llvmdc.ini --- a/bin/llvmdc.ini Tue Jul 29 18:00:01 2008 +0200 +++ b/bin/llvmdc.ini Tue Jul 29 21:52:25 2008 +0200 @@ -1,4 +1,2 @@ - [Environment] - -DFLAGS=-I%@P%/../tango -L-L%@P%/../lib -R%@P%/../lib +DFLAGS=-I%@P%/../tango -R%@P%/../lib diff -r 3dd9ae9ea708 -r ecf70fe065b9 dmd/mars.c --- a/dmd/mars.c Tue Jul 29 18:00:01 2008 +0200 +++ b/dmd/mars.c Tue Jul 29 21:52:25 2008 +0200 @@ -21,6 +21,8 @@ #if linux #include +#elif _WIN32 +#include #endif #include "mem.h" @@ -256,7 +258,13 @@ files.reserve(argc - 1); // Set default values +#if _WIN32 + char buf[MAX_PATH]; + GetModuleFileName(NULL, buf, MAX_PATH); + global.params.argv0 = buf; +#else global.params.argv0 = argv[0]; +#endif global.params.link = 1; global.params.useAssert = 0; global.params.useInvariants = 1; @@ -326,9 +334,9 @@ VersionCondition::addPredefinedGlobalIdent("all"); #if _WIN32 - inifile(argv[0], "llvmdc.ini"); + inifile(global.params.argv0, "llvmdc.ini"); #elif linux - inifile(argv[0], "llvmdc.conf"); + inifile(global.params.argv0, "llvmdc.conf"); #else #error #endif @@ -1065,7 +1073,7 @@ { if (global.params.link) //status = runLINK(); - linkExecutable(argv[0]); + linkExecutable(global.params.argv0); if (global.params.run) { diff -r 3dd9ae9ea708 -r ecf70fe065b9 dmd/module.h --- a/dmd/module.h Tue Jul 29 18:00:01 2008 +0200 +++ b/dmd/module.h Tue Jul 29 21:52:25 2008 +0200 @@ -109,7 +109,7 @@ Array *versionidsNot; // forward referenced version identifiers Macro *macrotable; // document comment macros - Escape *escapetable; // document comment escapes + struct Escape *escapetable; // document comment escapes Module(char *arg, Identifier *ident, int doDocComment, int doHdrGen); ~Module();