summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorjye2 <jye2@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-09 08:50:22 +0000
committerjye2 <jye2@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-09 08:50:22 +0000
commit1c9b820a9b327a5932e9c788b2847846ccbd018e (patch)
treec9f7d29dd85287f19f93e20d63a9e63a168ee41a /libcpp
parentbf3a4033b252b254629bf61115b24f3722810a35 (diff)
downloadgcc-1c9b820a9b327a5932e9c788b2847846ccbd018e.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210264 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/files.c10
-rw-r--r--libcpp/init.c4
3 files changed, 18 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 20171bc8e9e..619dfd8308a 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -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.
diff --git a/libcpp/files.c b/libcpp/files.c
index 7e887785444..ad68682e99e 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -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)
diff --git a/libcpp/init.c b/libcpp/init.c
index f10413ab3eb..b80951544d4 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -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);