aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog15
-rw-r--r--libcpp/include/cpplib.h4
-rw-r--r--libcpp/macro.c2
3 files changed, 17 insertions, 4 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index b69e364..5d2aa26 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,10 @@
+2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
+
+ PR other/70268
+ * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
+ * libcpp/macro.c (_cpp_builtin_macro_text): Call remap_filename for
+ __FILE__ and __BASE_FILE__.
+
2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
* lex.c (search_line_fast): Remove illegal coercion of an
@@ -19,7 +26,7 @@
2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
* internal.h (maybe_print_line): Change signature.
-
+
2017-12-05 Jakub Jelinek <jakub@redhat.com>
PR c++/79228
@@ -714,9 +721,9 @@
* init.c (cpp_init_source_date_epoch): New function.
* internal.h: Added source_date_epoch variable to struct
cpp_reader to store a reproducible date.
- * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
- pfile->source_date_epoch instead of localtime if source_date_epoch is
- set, to be used for __DATE__ and __TIME__ macros to help reproducible
+ * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
+ pfile->source_date_epoch instead of localtime if source_date_epoch is
+ set, to be used for __DATE__ and __TIME__ macros to help reproducible
builds.
2016-04-13 Bernd Schmidt <bschmidt@redhat.com>
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 7cc40c6..9814d0d 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -622,6 +622,10 @@ struct cpp_callbacks
C++-style comments it does not include the terminating newline. */
void (*comment) (cpp_reader *, source_location, const unsigned char *,
size_t);
+
+ /* Callback for filename remapping in __FILE__ and __BASE_FILE__ macro
+ expansions. */
+ const char *(*remap_filename) (const char*);
};
#ifdef VMS
diff --git a/libcpp/macro.c b/libcpp/macro.c
index 0f9f063..c5f3ffd 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -450,6 +450,8 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node,
if (!name)
abort ();
}
+ if (pfile->cb.remap_filename)
+ name = pfile->cb.remap_filename (name);
len = strlen (name);
buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
result = buf;