summaryrefslogtreecommitdiff
path: root/libcpp/directives.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-31 22:47:25 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-31 22:47:25 +0000
commitdf863d33ab916c6d45697eb5fc5c1d5682a8e107 (patch)
treef637ade47d19715a8cf418b551c01d28ece8d143 /libcpp/directives.c
parentfee106ed89c52617e2135074886d79ba5dca89ea (diff)
downloadgcc-df863d33ab916c6d45697eb5fc5c1d5682a8e107.tar.gz
PR preprocessor/45457
* expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if needed. * directives.c (do_ifdef, do_ifndef): Likewise. * c-c++-common/cpp/pr45457.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163705 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r--libcpp/directives.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 77da485cda1..997737bd4da 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -1,7 +1,7 @@
/* CPP Library. (Directive handling.)
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -1804,6 +1804,9 @@ do_ifdef (cpp_reader *pfile)
node->flags |= NODE_USED;
if (node->type == NT_MACRO)
{
+ if ((node->flags & NODE_BUILTIN)
+ && pfile->cb.user_builtin_macro)
+ pfile->cb.user_builtin_macro (pfile, node);
if (pfile->cb.used_define)
pfile->cb.used_define (pfile, pfile->directive_line, node);
}
@@ -1842,6 +1845,9 @@ do_ifndef (cpp_reader *pfile)
node->flags |= NODE_USED;
if (node->type == NT_MACRO)
{
+ if ((node->flags & NODE_BUILTIN)
+ && pfile->cb.user_builtin_macro)
+ pfile->cb.user_builtin_macro (pfile, node);
if (pfile->cb.used_define)
pfile->cb.used_define (pfile, pfile->directive_line, node);
}