]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
files.c (find_file_in_dir): Always try to shorten for DOS non-system headers.
authorJoey Ye <joey.ye@arm.com>
Fri, 9 May 2014 08:50:22 +0000 (08:50 +0000)
committerJoey Ye <jye2@gcc.gnu.org>
Fri, 9 May 2014 08:50:22 +0000 (08:50 +0000)
2014-05-09  Joey Ye  <joey.ye@arm.com>

* files.c (find_file_in_dir): Always try to shorten for DOS
non-system headers.
* init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.

From-SVN: r210264

libcpp/ChangeLog
libcpp/files.c
libcpp/init.c

index 20171bc8e9ece9c8d5601719f41ce016d72e4e01..619dfd8308aac752f8afec06c258953d2237a789 100644 (file)
@@ -1,3 +1,9 @@
+2014-05-09  Joey Ye  <joey.ye@arm.com>
+
+       * files.c (find_file_in_dir): Always try to shorten for DOS
+       non-system headers.
+       * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
+
 2014-05-07  Richard Biener  <rguenther@suse.de>
 
        * configure.ac: Always set need_64bit_hwint to yes.
index 7e8877854445d2029bdf40e983af70d050e05610..ad68682e99e74d765c5af42dcd50e3209942cda5 100644 (file)
@@ -387,8 +387,14 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
       char *copy;
       void **pp;
 
-      /* We try to canonicalize system headers.  */
-      if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp)
+      /* We try to canonicalize system headers.  For DOS based file
+       * system, we always try to shorten non-system headers, as DOS
+       * has a tighter constraint on max path length.  */
+      if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+         || !file->dir->sysp
+#endif
+        )
        {
          char * canonical_path = maybe_shorter_path (path);
          if (canonical_path)
index f10413ab3eb5899f5af40f6127211ee55b72d31c..b80951544d4ac387b6d8203f86bce47c8b537ddb 100644 (file)
@@ -27,8 +27,12 @@ along with this program; see the file COPYING3.  If not see
 #include "filenames.h"
 
 #ifndef ENABLE_CANONICAL_SYSTEM_HEADERS
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+#define ENABLE_CANONICAL_SYSTEM_HEADERS 1
+#else
 #define ENABLE_CANONICAL_SYSTEM_HEADERS 0
 #endif
+#endif
 
 static void init_library (void);
 static void mark_named_operators (cpp_reader *, int);