aboutsummaryrefslogtreecommitdiff
path: root/libcpp/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/expr.c')
-rw-r--r--libcpp/expr.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/libcpp/expr.c b/libcpp/expr.c
index 36c3fc4..201a619 100644
--- a/libcpp/expr.c
+++ b/libcpp/expr.c
@@ -1065,23 +1065,7 @@ 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 ((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);
- }
- else
- {
- if (pfile->cb.used_undef)
- pfile->cb.used_undef (pfile, pfile->directive_line, node);
- }
- }
+ _cpp_maybe_notify_macro_use (pfile, node);
/* A possible controlling macro of the form #if !defined ().
_cpp_parse_expr checks there was no other junk on the line. */
@@ -1097,8 +1081,8 @@ parse_defined (cpp_reader *pfile)
result.unsignedp = false;
result.high = 0;
result.overflow = false;
- result.low = (node && node->type == NT_MACRO
- && (node->flags & NODE_CONDITIONAL) == 0);
+ result.low = (node && cpp_macro_p (node)
+ && !(node->flags & NODE_CONDITIONAL));
return result;
}