summaryrefslogtreecommitdiff
path: root/libcpp/files.c
diff options
context:
space:
mode:
authorgfunck <gfunck@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-09 08:48:43 +0000
committergfunck <gfunck@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-09 08:48:43 +0000
commit5e79140626a9d7be3f384af82b3da0c6f0d12aaf (patch)
tree2b2f237168b3048e8f7a77942d33aaf369c7cae0 /libcpp/files.c
parent3f7685cdb9aca9d689f73e53baccfbcfbf043669 (diff)
downloadgcc-5e79140626a9d7be3f384af82b3da0c6f0d12aaf.tar.gz
libcpp/
PR preprocessor/33919 * files.c (_cpp_get_file_name): New. Implement file name access function. * internal.h (_cpp_get_file_name): New prototype. * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name() to use pfile->main_file in lieu of traversing INCLUDED_FROM chain. gcc/testsuite/ PR preprocessor/33919 * gcc.dg/pr33919.c: New test. * gcc.dg/pr33919-0.h: New test header file. * gcc.dg/pr33919-1.h: Ditto. * gcc.dg/pr33919-2.h: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183003 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/files.c')
-rw-r--r--libcpp/files.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libcpp/files.c b/libcpp/files.c
index fad8b75fe57..29ccf3b7013 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -1,7 +1,7 @@
/* Part of CPP library. File handling.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -1370,6 +1370,13 @@ _cpp_pop_file_buffer (cpp_reader *pfile, _cpp_file *file)
}
}
+/* Return the file name associated with FILE. */
+const char *
+_cpp_get_file_name (_cpp_file *file)
+{
+ return file->name;
+}
+
/* Inteface to file statistics record in _cpp_file structure. */
struct stat *
_cpp_get_file_stat (_cpp_file *file)