aboutsummaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-16 16:45:14 -0700
committerMichael Forney <mforney@mforney.org>2019-04-16 17:11:41 -0700
commit07ca02cc2d0a2137433f29186aa838d68ded7e9a (patch)
tree90ba44d32a5e9d67eea54b101c9c9d319889867d /expr.c
parentb41df7f83792799f1a9662b83008ea6f64dc73e1 (diff)
Implement __builtin_types_compatible_p
This is used by util-linux.
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/expr.c b/expr.c
index 28585c9..5c3e688 100644
--- a/expr.c
+++ b/expr.c
@@ -442,6 +442,11 @@ builtinfunc(struct scope *s, enum builtinkind kind)
e = mkconstexpr(&typeulong, offset);
free(name);
break;
+ case BUILTINTYPESCOMPATIBLEP:
+ t = typename(s, NULL);
+ expect(TCOMMA, "after type name");
+ e = mkconstexpr(&typeint, typecompatible(t, typename(s, NULL)));
+ break;
case BUILTINVAARG:
e = mkexpr(EXPRBUILTIN, NULL);
e->builtin.kind = BUILTINVAARG;