summaryrefslogtreecommitdiffstats
path: root/gcc/fix-header.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-15 12:18:47 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-15 12:18:47 +0000
commitfc3c77209b1bf362b48cf46156997fb45a71d85f (patch)
tree9ab94f87b27944c394c8bce04fc6f0433140ed8b /gcc/fix-header.c
parent9ae1acf5e76c1a513c647e601e643051394cdf25 (diff)
downloadppe42-gcc-fc3c77209b1bf362b48cf46156997fb45a71d85f.tar.gz
ppe42-gcc-fc3c77209b1bf362b48cf46156997fb45a71d85f.zip
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins. * c-lex.c (init_c_lex): Register builtins hook is dead. * c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U. (c_common_decode_option): Don't call cpp_handle_option. Handle -A, -D and -U. (handle_deferred_opts): Simplify. (finish_options): Define builtins and command line macros. * c-ppoutput.c (init_pp_output): Register builtins hook is dead. * cppinit.c: Don't include intl.h. (init_builtins): Rename cpp_init_builtins. No hook to call. (init_library): Don't need to sort options. (cpp_create_reader): Don't set pending. (cpp_destroy): Don't free pending. (struct pending_option, cl_directive_handler, struct cpp_pending, APPEND, free_chain, new_pending_directive, parse_option, opt_comp, cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option, cl_options, cpp_handle_option): Remove. * cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option, cpp_finish_options): Remove. (cpp_init_builtins): New. * fix-header.c (read_scan_file): Update to handle -D. Fix handling of -I. Replace call to cpp_finish_options. cp: * Make-lang.in: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64398 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fix-header.c')
-rw-r--r--gcc/fix-header.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 2bf4692f999..930728ee73b 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -1,6 +1,6 @@
/* fix-header.c - Make C header file suitable for C++.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -67,7 +67,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
* INFILE.H is a full pathname for the input file (e.g. /usr/include/stdio.h)
* OUTFILE.H is the full pathname for where to write the output file,
if anything needs to be done. (e.g. ./include/stdio.h)
- * OPTIONS are such as you would pass to cpp.
+ * OPTIONS can be -D or -I switches as you would pass to cpp.
Written by Per Bothner <bothner@cygnus.com>, July 1993. */
@@ -634,17 +634,28 @@ read_scan_file (in_fname, argc, argv)
for (i = 0; i < argc; i += strings_processed)
{
- if (argv[i][0] == 'I')
+ strings_processed = 0;
+ if (argv[i][0] == '-')
{
- if (argv[i][1] != '\0')
- strings_processed = 1, add_path (argv[i] + 1, BRACKET, false);
- else if (i + 1 == argc)
- strings_processed = 0;
- else
- strings_processed = 2, add_path (argv[i + 1], BRACKET, false);
+ if (argv[i][1] == 'I')
+ {
+ if (argv[i][2] != '\0')
+ strings_processed = 1, add_path (argv[i] + 2, BRACKET, false);
+ else if (i + 1 == argc)
+ strings_processed = 0;
+ else
+ strings_processed = 2, add_path (argv[i + 2], BRACKET, false);
+ }
+ else if (argv[i][1] == 'D')
+ {
+ if (argv[i][2] != '\0')
+ strings_processed = 1, cpp_define (scan_in, argv[i] + 2);
+ else if (i + 1 == argc)
+ strings_processed = 0;
+ else
+ strings_processed = 2, cpp_define (scan_in, argv[i + 1]);
+ }
}
- else
- strings_processed = cpp_handle_option (scan_in, argc - i, argv + i);
if (strings_processed == 0)
break;
@@ -661,7 +672,9 @@ read_scan_file (in_fname, argc, argv)
if (! cpp_read_main_file (scan_in, in_fname, NULL))
exit (FATAL_EXIT_CODE);
- cpp_finish_options (scan_in);
+ cpp_rename_file (scan_in, "<built-in>");
+ cpp_init_builtins (scan_in);
+ cpp_rename_file (scan_in, in_fname);
/* We are scanning a system header, so mark it as such. */
cpp_make_system_header (scan_in, 1, 0);
OpenPOWER on IntegriCloud