aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-10-07 18:48:55 +0000
committerRichard Stallman <rms@gnu.org>1993-10-07 18:48:55 +0000
commitd2a228624e9a525f7198e97de2ee57b363422ace (patch)
tree006b61b79dae6852aba85884746b654ddfcc6d18 /gcc
parent9eb9177211dea7f3077b6fc6b56ad0bea812e485 (diff)
downloadgcc-d2a228624e9a525f7198e97de2ee57b363422ace.zip
gcc-d2a228624e9a525f7198e97de2ee57b363422ace.tar.gz
gcc-d2a228624e9a525f7198e97de2ee57b363422ace.tar.bz2
(struct file_name_list): Add new field c_system_include_path.
(*various*): Set this flag correctly (is_system_include): Return 2 if C-language system include. (output_line_command): Output " 4" after " 3" for C-language system include. From-SVN: r5659
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index e1a654e..d659da5 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -540,6 +540,9 @@ struct file_name_list
/* If the following is nonzero, it is a macro name.
Don't include the file again if that macro is defined. */
U_CHAR *control_macro;
+ /* If the following is nonzero, it is a C-language system include
+ directory. */
+ int c_system_include_path;
};
/* #include "file" looks in source file dir, then stack. */
@@ -1121,6 +1124,7 @@ main (argc, argv)
xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
if (i + 1 == argc)
fatal ("Directory name missing after `-iwithprefix' option");
@@ -1154,6 +1158,7 @@ main (argc, argv)
xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
if (i + 1 == argc)
fatal ("Directory name missing after `-iwithprefixbefore' option");
@@ -1172,6 +1177,7 @@ main (argc, argv)
xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
if (i + 1 == argc)
fatal ("Directory name missing after `-idirafter' option");
else
@@ -1421,6 +1427,7 @@ main (argc, argv)
xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
if (argv[i][2] != 0)
dirtmp->fname = argv[i] + 2;
else if (i + 1 == argc)
@@ -1684,6 +1691,7 @@ main (argc, argv)
strcat (str, p->fname + default_len);
new->fname = str;
new->control_macro = 0;
+ new->c_system_include_path = !p->cplusplus;
append_include_chain (new, new);
if (first_system_include == 0)
first_system_include = new;
@@ -1697,6 +1705,7 @@ main (argc, argv)
struct file_name_list *new
= (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
new->control_macro = 0;
+ new->c_system_include_path = !p->cplusplus;
new->fname = p->fname;
append_include_chain (new, new);
if (first_system_include == 0)
@@ -2015,6 +2024,7 @@ path_include (path)
xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
dirtmp->fname = name;
append_include_chain (dirtmp, dirtmp);
@@ -4094,6 +4104,7 @@ get_filename:
ptr = (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
ptr->control_macro = 0;
+ ptr->c_system_include_path = 0;
ptr->next = all_include_files;
all_include_files = ptr;
ptr->fname = savestring (fname);
@@ -4203,7 +4214,12 @@ is_system_include (filename)
register unsigned length = strlen (sys_dir);
if (! strncmp (sys_dir, filename, length) && filename[length] == '/')
- return 1;
+ {
+ if (searchptr->c_system_include_path)
+ return 2;
+ else
+ return 1;
+ }
}
return 0;
}
@@ -6099,6 +6115,7 @@ do_once ()
dont_repeat_files = new;
new->fname = savestring (ip->fname);
new->control_macro = 0;
+ new->c_system_include_path = 0;
}
return 0;
}
@@ -7088,6 +7105,11 @@ output_line_command (ip, op, conditional, file_change)
*line_end++ = ' ';
*line_end++ = '3';
}
+ /* Tell cc1plus if following text should be treated as C. */
+ if (ip->system_header_p == 2) {
+ *line_end++ = ' ';
+ *line_end++ = '4';
+ }
*line_end++ = '\n';
len = line_end - line_cmd_buf;
check_expand (op, len + 1);