Commit 498f1c82 by Nathan Sidwell Committed by Nathan Sidwell

c-incpath.c (INO_T_EQ): Do not define on non-inode systems.

	* c-incpath.c (INO_T_EQ): Do not define on non-inode systems.
	(DIRS_EQ): New.
	(remove_duplicates): Do not set inode on non-inode systems.  Use
	DIRS_EQ.

From-SVN: r135661
parent 95b42490
2008-05-20 Nathan Sidwell <nathan@codesourcery.com>
* c-incpath.c (INO_T_EQ): Do not define on non-inode systems.
(DIRS_EQ): New.
(remove_duplicates): Do not set inode on non-inode systems. Use
DIRS_EQ.
2008-05-20 Sandra Loosemore <sandra@codesourcery.com> 2008-05-20 Sandra Loosemore <sandra@codesourcery.com>
* config.gcc (tm_file): Update comments about relative pathnames. * config.gcc (tm_file): Update comments about relative pathnames.
......
...@@ -37,15 +37,18 @@ ...@@ -37,15 +37,18 @@
#ifdef VMS #ifdef VMS
# define INO_T_EQ(A, B) (!memcmp (&(A), &(B), sizeof (A))) # define INO_T_EQ(A, B) (!memcmp (&(A), &(B), sizeof (A)))
# define INO_T_COPY(DEST, SRC) memcpy(&(DEST), &(SRC), sizeof (SRC)) # define INO_T_COPY(DEST, SRC) memcpy(&(DEST), &(SRC), sizeof (SRC))
#else #elif !((defined _WIN32 && !defined (_UWIN)) || defined __MSDOS__)
# if (defined _WIN32 && !defined (_UWIN)) || defined __MSDOS__ # define INO_T_EQ(A, B) ((A) == (B))
# define INO_T_EQ(A, B) 0
# else
# define INO_T_EQ(A, B) ((A) == (B))
# endif
# define INO_T_COPY(DEST, SRC) (DEST) = (SRC) # define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
#endif #endif
#if defined INO_T_EQ
#define DIRS_EQ(A, B) ((A)->dev == (B)->dev \
&& INO_T_EQ((A)->ino, (B)->ino))
#else
#define DIRS_EQ(A, B) (!strcasecmp ((A)->name, (B)->name))
#endif
static const char dir_separator_str[] = { DIR_SEPARATOR, 0 }; static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
static void add_env_var_paths (const char *, int); static void add_env_var_paths (const char *, int);
...@@ -241,14 +244,15 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, ...@@ -241,14 +244,15 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
"%s: not a directory", cur->name); "%s: not a directory", cur->name);
else else
{ {
#if defined (INO_T_COPY)
INO_T_COPY (cur->ino, st.st_ino); INO_T_COPY (cur->ino, st.st_ino);
cur->dev = st.st_dev; cur->dev = st.st_dev;
#endif
/* Remove this one if it is in the system chain. */ /* Remove this one if it is in the system chain. */
reason = REASON_DUP_SYS; reason = REASON_DUP_SYS;
for (tmp = system; tmp; tmp = tmp->next) for (tmp = system; tmp; tmp = tmp->next)
if (INO_T_EQ (tmp->ino, cur->ino) && tmp->dev == cur->dev if (DIRS_EQ (tmp, cur) && cur->construct == tmp->construct)
&& cur->construct == tmp->construct)
break; break;
if (!tmp) if (!tmp)
...@@ -256,16 +260,14 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, ...@@ -256,16 +260,14 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
/* Duplicate of something earlier in the same chain? */ /* Duplicate of something earlier in the same chain? */
reason = REASON_DUP; reason = REASON_DUP;
for (tmp = head; tmp != cur; tmp = tmp->next) for (tmp = head; tmp != cur; tmp = tmp->next)
if (INO_T_EQ (cur->ino, tmp->ino) && cur->dev == tmp->dev if (DIRS_EQ (cur, tmp) && cur->construct == tmp->construct)
&& cur->construct == tmp->construct)
break; break;
if (tmp == cur if (tmp == cur
/* Last in the chain and duplicate of JOIN? */ /* Last in the chain and duplicate of JOIN? */
&& !(cur->next == NULL && join && !(cur->next == NULL && join
&& INO_T_EQ (cur->ino, join->ino) && DIRS_EQ (cur, join)
&& cur->dev == join->dev && cur->construct == join->construct))
&& cur->construct == join->construct))
{ {
/* Unique, so keep this directory. */ /* Unique, so keep this directory. */
pcur = &cur->next; pcur = &cur->next;
...@@ -297,8 +299,8 @@ add_sysroot_to_chain (const char *sysroot, int chain) ...@@ -297,8 +299,8 @@ add_sysroot_to_chain (const char *sysroot, int chain)
} }
/* Merge the four include chains together in the order quote, bracket, /* Merge the four include chains together in the order quote, bracket,
system, after. Remove duplicate dirs (as determined by system, after. Remove duplicate dirs (determined in
INO_T_EQ()). system-specific manner).
We can't just merge the lists and then uniquify them because then We can't just merge the lists and then uniquify them because then
we may lose directories from the <> search path that should be we may lose directories from the <> search path that should be
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment