changeset 432:ecf70fe065b9

fixed configuration file loading issues on windows
author elrood
date Tue, 29 Jul 2008 21:52:25 +0200
parents 3dd9ae9ea708
children b5f55f471e0b
files bin/llvmdc.ini dmd/mars.c dmd/module.h
diffstat 3 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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 <errno.h>
+#elif _WIN32
+#include <windows.h>
 #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)
 	{
--- 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();