summaryrefslogtreecommitdiffstats
path: root/libcpp/internal.h
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-04 15:32:26 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-04 15:32:26 +0000
commit927b511f7eac5563ce4fbbd32dee24e10ef52357 (patch)
treeb221eae7c64169c5383839dda76552523ac6432e /libcpp/internal.h
parentd272bed8bba6a66ff9c40f4287c13481c8c996cf (diff)
downloadppe42-gcc-927b511f7eac5563ce4fbbd32dee24e10ef52357.tar.gz
ppe42-gcc-927b511f7eac5563ce4fbbd32dee24e10ef52357.zip
libcpp
PR preprocessor/28165: * internal.h (cpp_in_primary_file): New function. * directives.c (do_include_next): Use cpp_in_primary_file. (do_pragma_once): Likewise. (do_pragma_system_header): Likewise. gcc/testsuite PR preprocessor/28165: * gcc.dg/cpp/pr28165.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120441 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/internal.h')
-rw-r--r--libcpp/internal.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libcpp/internal.h b/libcpp/internal.h
index 857bfe1d8c5..20f42358051 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -1,5 +1,5 @@
/* Part of CPP library.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -488,6 +488,13 @@ cpp_in_system_header (cpp_reader *pfile)
#define CPP_PEDANTIC(PF) CPP_OPTION (PF, pedantic)
#define CPP_WTRADITIONAL(PF) CPP_OPTION (PF, warn_traditional)
+static inline int cpp_in_primary_file (cpp_reader *);
+static inline int
+cpp_in_primary_file (cpp_reader *pfile)
+{
+ return pfile->line_table->depth == 1;
+}
+
/* In errors.c */
extern int _cpp_begin_message (cpp_reader *, int,
source_location, unsigned int);
OpenPOWER on IntegriCloud