[PATCH 5/5] Handle one case of returning struct pointers
[Thread Prev] | [Thread Next]
- Subject: [PATCH 5/5] Handle one case of returning struct pointers
- From: "S. Gilles" <sgilles@xxxxxxx>
- Reply-to: myrddin-dev@xxxxxxxxxxxxxx
- Date: Sun, 10 May 2020 20:38:07 -0400
- To: "myrddin-dev" <myrddin-dev@xxxxxxxxxxxxxx>
- Cc: "S. Gilles" <sgilles@xxxxxxx>
---
cglue.myr | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/cglue.myr b/cglue.myr
index fe9a512..da6d407 100644
--- a/cglue.myr
+++ b/cglue.myr
@@ -86,7 +86,7 @@ const declare = {buf, name, ty, nptr
| `Tydefn def: -> std.bfmt(buf, "{} {}{}{}{}", def.name, s, p, name, e)
| `Typtr sub: -> declare(buf, name, sub, nptr + 1)
| `Tyarr arr: -> declarearray(buf, name, arr, nptr)
- | `Tystruct st: -> declarestruct(buf, name, st, nptr)
+ | `Tystruct st: -> declarestruct(buf, name, st, s, p, e)
| `Tyenum en: -> declareenum(buf, name, en, nptr)
| `Tyfunc fn: -> declarefunc(buf, name, fn, nptr)
;;
@@ -102,8 +102,15 @@ const declarearray = {buf, name, arr, nptr
-> declare(buf, n, &arr.subty, nptr)
}
-const declarestruct = {buf, name, st, nptr
- -> "struct"
+const declarestruct = {buf, name, st, s, p, e
+ match st
+ | &`Body b:
+ match b.tag
+ | `std.Some tag: -> std.bfmt(buf, "struct {} {}{}{}{}", tag, s, p, name, e)
+ | _: -> "struct"
+ ;;
+ | _: -> "struct"
+ ;;
}
const declareenum = {buf, name, e, nptr
--
2.26.2
| [PATCH 0/5] mcbind patches, round 2 | "S. Gilles" <sgilles@xxxxxxx> |
- Prev by Date: [PATCH 3/5] Wrap function argument type name emissions in getname
- Next by Date: [PATCH 0/5] mcbind patches, round 2
- Previous by thread: [PATCH 3/5] Wrap function argument type name emissions in getname
- Next by thread: [PATCH 4/5] Check anonstructs a few more times
- Index(es):