From be5a5e03d8e0484ed3ca40c912ec4f614397f1d5 Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 3 May 2013 23:25:06 -0400 Subject: [PATCH] Changed the order of directories that are searched for include files. --- src/ca65/incpath.c | 18 ++++++++++++------ src/ca65/incpath.h | 5 ++++- src/ca65/main.c | 5 ++++- src/cc65/incpath.c | 18 ++++++++++++------ src/cc65/incpath.h | 5 ++++- src/cc65/main.c | 5 ++++- 6 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/ca65/incpath.c b/src/ca65/incpath.c index ab0db8443..a5968cb57 100644 --- a/src/ca65/incpath.c +++ b/src/ca65/incpath.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000-2010, Ullrich von Bassewitz */ +/* (C) 2000-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -70,17 +70,23 @@ void InitIncludePaths (void) /* Create the search path lists */ IncSearchPath = NewSearchPath (); BinSearchPath = NewSearchPath (); +} + - /* Add some compiled in search paths if defined at compile time */ -#ifdef CA65_INC - AddSearchPath (IncSearchPath, STRINGIZE (CA65_INC)); -#endif +void FinishIncludePaths (void) +/* Finish creating the include path search list. */ +{ /* Add specific paths from the environment */ AddSearchPathFromEnv (IncSearchPath, "CA65_INC"); - /* Add paths relative to a main directory defined in an env var */ + /* Add paths relative to a main directory defined in an env. var. */ AddSubSearchPathFromEnv (IncSearchPath, "CC65_HOME", "asminc"); + + /* Add some compiled-in search paths if defined at compile time. */ +#ifdef CA65_INC + AddSearchPath (IncSearchPath, STRINGIZE (CA65_INC)); +#endif } diff --git a/src/ca65/incpath.h b/src/ca65/incpath.h index b2484cc96..96992a697 100644 --- a/src/ca65/incpath.h +++ b/src/ca65/incpath.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000-2010, Ullrich von Bassewitz */ +/* (C) 2000-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -66,6 +66,9 @@ void ForgetAllIncludePaths (void); void InitIncludePaths (void); /* Initialize the include path search list */ +void FinishIncludePaths (void); +/* Finish creating the include path search list. */ + /* End of incpath.h */ diff --git a/src/ca65/main.c b/src/ca65/main.c index f05cd3415..6e9e1e494 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -5,7 +5,7 @@ /* */ /* */ /* */ -/* (C) 1998-2012, Ullrich von Bassewitz */ +/* (C) 1998-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -1016,6 +1016,9 @@ int main (int argc, char* argv []) exit (EXIT_FAILURE); } + /* Add the default include search paths. */ + FinishIncludePaths (); + /* If no CPU given, use the default CPU for the target */ if (GetCPU () == CPU_UNKNOWN) { if (Target != TGT_UNKNOWN) { diff --git a/src/cc65/incpath.c b/src/cc65/incpath.c index 275fc844d..6e07f8f77 100644 --- a/src/cc65/incpath.c +++ b/src/cc65/incpath.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000-2012, Ullrich von Bassewitz */ +/* (C) 2000-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -70,18 +70,24 @@ void InitIncludePaths (void) /* Create the search path lists */ SysIncSearchPath = NewSearchPath (); UsrIncSearchPath = NewSearchPath (); +} + - /* Add some compiled in search paths if defined at compile time */ -#ifdef CC65_INC - AddSearchPath (SysIncSearchPath, STRINGIZE (CC65_INC)); -#endif +void FinishIncludePaths (void) +/* Finish creating the include path search lists. */ +{ /* Add specific paths from the environment */ AddSearchPathFromEnv (SysIncSearchPath, "CC65_INC"); AddSearchPathFromEnv (UsrIncSearchPath, "CC65_INC"); - /* Add paths relative to a main directory defined in an env var */ + /* Add paths relative to a main directory defined in an env. var. */ AddSubSearchPathFromEnv (SysIncSearchPath, "CC65_HOME", "include"); + + /* Add some compiled-in search paths if defined at compile time. */ +#ifdef CC65_INC + AddSearchPath (SysIncSearchPath, STRINGIZE (CC65_INC)); +#endif } diff --git a/src/cc65/incpath.h b/src/cc65/incpath.h index dba920f6d..99096b8ae 100644 --- a/src/cc65/incpath.h +++ b/src/cc65/incpath.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000-2010, Ullrich von Bassewitz */ +/* (C) 2000-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -66,6 +66,9 @@ void ForgetAllIncludePaths (void); void InitIncludePaths (void); /* Initialize the include path search list */ +void FinishIncludePaths (void); +/* Finish creating the include path search lists. */ + /* End of incpath.h */ diff --git a/src/cc65/main.c b/src/cc65/main.c index 461d8b95a..d2996e1b5 100644 --- a/src/cc65/main.c +++ b/src/cc65/main.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000-2012, Ullrich von Bassewitz */ +/* (C) 2000-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -957,6 +957,9 @@ int main (int argc, char* argv[]) AbEnd ("No input files"); } + /* Add the default include search paths. */ + FinishIncludePaths (); + /* Create the output file name if it was not explicitly given */ MakeDefaultOutputName (InputFile); -- 2.39.5