summaryrefslogtreecommitdiff
path: root/libcpp/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/expr.c')
-rw-r--r--libcpp/expr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libcpp/expr.c b/libcpp/expr.c
index 9df75332c05..9e89dd9574a 100644
--- a/libcpp/expr.c
+++ b/libcpp/expr.c
@@ -637,6 +637,20 @@ parse_defined (cpp_reader *pfile)
"this use of \"defined\" may not be portable");
_cpp_mark_macro_used (node);
+ if (!(node->flags & NODE_USED))
+ {
+ node->flags |= NODE_USED;
+ if (node->type == NT_MACRO)
+ {
+ if (pfile->cb.used_define)
+ pfile->cb.used_define (pfile, pfile->directive_line, node);
+ }
+ else
+ {
+ if (pfile->cb.used_undef)
+ pfile->cb.used_undef (pfile, pfile->directive_line, node);
+ }
+ }
/* A possible controlling macro of the form #if !defined ().
_cpp_parse_expr checks there was no other junk on the line. */