fixed configuration file loading issues on windows

This commit is contained in:
elrood
2008-07-29 21:52:25 +02:00
parent f439de46ab
commit dbe905604b
3 changed files with 13 additions and 7 deletions

View File

@@ -1,4 +1,2 @@
[Environment]
DFLAGS=-I%@P%/../tango -L-L%@P%/../lib -R%@P%/../lib
DFLAGS=-I%@P%/../tango -R%@P%/../lib

View File

@@ -21,6 +21,8 @@
#if linux
#include <errno.h>
#elif _WIN32
#include <windows.h>
#endif
#include "mem.h"
@@ -256,7 +258,13 @@ int main(int argc, char *argv[])
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 @@ int main(int argc, char *argv[])
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 @@ int main(int argc, char *argv[])
{
if (global.params.link)
//status = runLINK();
linkExecutable(argv[0]);
linkExecutable(global.params.argv0);
if (global.params.run)
{

View File

@@ -109,7 +109,7 @@ struct Module : Package
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();