aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-08-29 18:37:37 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-08-29 18:37:37 +0000
commit2c8f0515bbed378f1e87e1b52e2913d058cbed16 (patch)
tree7f03453e92f612da7c6531488d3878a73dbda657 /gcc/cpplib.c
parent5c5d1cd68a748299a244a6b9fd7c3fce2f09d582 (diff)
downloadgcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.zip
gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.tar.gz
gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.tar.bz2
cpperror.c (print_file_and_line): If line is (unsigned int)-1, print just the filename.
* cpperror.c (print_file_and_line): If line is (unsigned int)-1, print just the filename. * cpplex.c (_cpp_run_directive): Add additional argument, the name to give the synthetic buffer. This defaults to translated "<command line>". * cpplib.c (cpp_define, cpp_undef, cpp_assert, cpp_unassert): Adjust to match. (_cpp_define_builtin): New function. * cppinit.c (initialize_builtins): Use _cpp_define_builtin. * cpphash.h: Update prototypes. * tradcpp.c (main): Process -D and -U simultaneously, in the order they appeared on the command line. From-SVN: r36043
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 2cc956d..3273dce 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -1410,7 +1410,20 @@ cpp_define (pfile, str)
strcpy (&buf[count-4], " 1\n");
}
- _cpp_run_directive (pfile, &dtable[T_DEFINE], buf, count - 1);
+ _cpp_run_directive (pfile, &dtable[T_DEFINE], buf, count - 1, 0);
+}
+
+/* Slight variant of the above for use by initialize_builtins, which (a)
+ knows how to set up the buffer itself, (b) needs a different "filename"
+ tag. */
+void
+_cpp_define_builtin (pfile, str)
+ cpp_reader *pfile;
+ const char *str;
+{
+ _cpp_run_directive (pfile, &dtable[T_DEFINE],
+ str, strlen (str),
+ _("<builtin>"));
}
/* Process MACRO as if it appeared as the body of an #undef. */
@@ -1419,7 +1432,7 @@ cpp_undef (pfile, macro)
cpp_reader *pfile;
const char *macro;
{
- _cpp_run_directive (pfile, &dtable[T_UNDEF], macro, strlen (macro));
+ _cpp_run_directive (pfile, &dtable[T_UNDEF], macro, strlen (macro), 0);
}
/* Process the string STR as if it appeared as the body of a #assert. */
@@ -1428,7 +1441,7 @@ cpp_assert (pfile, str)
cpp_reader *pfile;
const char *str;
{
- _cpp_run_directive (pfile, &dtable[T_ASSERT], str, strlen (str));
+ _cpp_run_directive (pfile, &dtable[T_ASSERT], str, strlen (str), 0);
}
/* Process STR as if it appeared as the body of an #unassert. */
@@ -1437,7 +1450,7 @@ cpp_unassert (pfile, str)
cpp_reader *pfile;
const char *str;
{
- _cpp_run_directive (pfile, &dtable[T_UNASSERT], str, strlen (str));
+ _cpp_run_directive (pfile, &dtable[T_UNASSERT], str, strlen (str), 0);
}
/* Determine whether the identifier ID, of length LEN, is a defined macro. */