OSDN Git Service

PR c/20740
[pf3gnuchains/gcc-fork.git] / gcc / c-incpath.c
index 177af98..62680bd 100644 (file)
@@ -1,6 +1,6 @@
 /* Set up combined include path chain for the preprocessor.
    Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
    Broken out of cppinit.c and cppfiles.c and rewritten Mar 2003.
 
@@ -211,7 +211,8 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
          /* Remove this one if it is in the system chain.  */
          reason = REASON_DUP_SYS;
          for (tmp = system; tmp; tmp = tmp->next)
-           if (INO_T_EQ (tmp->ino, cur->ino) && tmp->dev == cur->dev)
+           if (INO_T_EQ (tmp->ino, cur->ino) && tmp->dev == cur->dev
+               && cur->construct == tmp->construct)
              break;
 
          if (!tmp)
@@ -219,14 +220,16 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
              /* Duplicate of something earlier in the same chain?  */
              reason = REASON_DUP;
              for (tmp = head; tmp != cur; tmp = tmp->next)
-               if (INO_T_EQ (cur->ino, tmp->ino) && cur->dev == tmp->dev)
+               if (INO_T_EQ (cur->ino, tmp->ino) && cur->dev == tmp->dev
+                   && cur->construct == tmp->construct)
                  break;
 
              if (tmp == cur
                  /* Last in the chain and duplicate of JOIN?  */
                  && !(cur->next == NULL && join
                       && INO_T_EQ (cur->ino, join->ino)
-                      && cur->dev == join->dev))
+                      && cur->dev == join->dev
+                      && cur->construct == join->construct))
                {
                  /* Unique, so keep this directory.  */
                  pcur = &cur->next;
@@ -329,7 +332,7 @@ add_path (char *path, int chain, int cxx_aware, bool user_supplied_p)
 
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
   /* Convert all backslashes to slashes.  The native CRT stat()
-     function does not recognise a directory that ends in a backslash
+     function does not recognize a directory that ends in a backslash
      (unless it is a drive root dir, such "c:\").  Forward slashes,
      trailing or otherwise, cause no problems for stat().  */
   char* c;