]> git.sur5r.net Git - cc65/commitdiff
Fixed an include file search order problem
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 27 May 2003 21:48:05 +0000 (21:48 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 27 May 2003 21:48:05 +0000 (21:48 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2173 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/compile.c
src/cc65/incpath.c
src/cc65/incpath.h
src/cc65/main.c

index 766cd79656fa1cb3d4381a18f6886529ab527bc3..858f855b12650576130b1ebb7b37a90018968941 100644 (file)
@@ -6,9 +6,9 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2002 Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
+/* (C) 2000-2003 Ullrich von Bassewitz                                       */
+/*               Römerstrasse 52                                             */
+/*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
@@ -51,7 +51,6 @@
 #include "expr.h"
 #include "function.h"
 #include "global.h"
-#include "incpath.h"
 #include "input.h"
 #include "litpool.h"
 #include "macrotab.h"
@@ -270,7 +269,6 @@ static void Parse (void)
 void Compile (const char* FileName)
 /* Top level compile routine. Will setup things and call the parser. */
 {
-    char*       Path;
     char        Buf[20];
     char        DateStr[20];
     char        TimeStr[20];
@@ -285,19 +283,6 @@ void Compile (const char* FileName)
         "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
     };
 
-    /* Add some standard paths to the include search path */
-    AddIncludePath ("", INC_USER);             /* Current directory */
-    AddIncludePath ("include", INC_SYS);
-#ifdef CC65_INC
-    AddIncludePath (CC65_INC, INC_SYS);
-#else
-    AddIncludePath ("/usr/lib/cc65/include", INC_SYS);
-#endif
-    Path = getenv ("CC65_INC");
-    if (Path) {
-       AddIncludePath (Path, INC_SYS | INC_USER);
-    }
-
     /* Add macros that are always defined */
     DefineNumericMacro ("__CC65__", (VER_MAJOR * 0x100) + (VER_MINOR * 0x10) + VER_PATCH);
 
index 767ad2a86e7b4832b81dd4e6b2f74a18536ea3cd..0d2110d6aafe12b84eef1db624a8052337e27bf2 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000      Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
-/* EMail:        uz@musoftware.de                                            */
+/* (C) 2000-2003 Ullrich von Bassewitz                                       */
+/*               Römerstrasse 52                                             */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -34,6 +34,7 @@
 
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #if defined(_MSC_VER)
 /* Microsoft compiler */
@@ -190,3 +191,24 @@ char* FindInclude (const char* Name, unsigned Where)
 
 
 
+void InitIncludePaths (void)
+/* Initialize the include path search list */
+{
+    const char* Path;
+
+    /* Add some standard paths to the include search path */
+    AddIncludePath ("", INC_USER);             /* Current directory */
+    AddIncludePath ("include", INC_SYS);
+#ifdef CC65_INC
+    AddIncludePath (CC65_INC, INC_SYS);
+#else
+    AddIncludePath ("/usr/lib/cc65/include", INC_SYS);
+#endif
+    Path = getenv ("CC65_INC");
+    if (Path) {
+       AddIncludePath (Path, INC_SYS | INC_USER);
+    }
+}
+
+
+
index 6e83de21dd83b27cf4ed82098338a8ae0dd51d28..2554900c7569775bda2665564809b5ed54f0f475 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000      Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
-/* EMail:        uz@musoftware.de                                            */
+/* (C) 2000-2003 Ullrich von Bassewitz                                       */
+/*               Römerstrasse 52                                             */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -63,6 +63,9 @@ char* FindInclude (const char* Name, unsigned Where);
  * the complete path, if found, return 0 otherwise.
  */
 
+void InitIncludePaths (void);
+/* Initialize the include path search list */
+
 
 
 /* End of incpath.h */
index 9fda4f169c7e71a07b20361b81728f00cf3c6658..3a548b5cc216955fde6077a44c8b11497c14e05e 100644 (file)
@@ -6,9 +6,9 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2002 Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
+/* (C) 2000-2003 Ullrich von Bassewitz                                       */
+/*               Römerstrasse 52                                             */
+/*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
@@ -655,6 +655,9 @@ int main (int argc, char* argv[])
     /* Initialize the default segment names */
     InitSegNames ();
 
+    /* Initialize the include search paths */
+    InitIncludePaths ();
+
     /* Parse the command line */
     I = 1;
     while (I < ArgCount) {