allocator interface (first pass)

This commit is contained in:
2026-07-06 21:24:49 +02:00
parent 7ce3917c15
commit 95c61311ca
24 changed files with 833 additions and 161 deletions
+6 -2
View File
@@ -99,7 +99,11 @@ render_type :: proc(b: ^strings.Builder, result: ^cimport.Result, id: cimport.Ty
if item.mutable {
strings.write_string(b, "mut ")
}
render_type(b, result, item.child, record_names)
if int(item.child) >= 0 && int(item.child) < len(result.types) && result.types[item.child].kind == .Void {
strings.write_string(b, "anyopaque")
} else {
render_type(b, result, item.child, record_names)
}
case .Array:
fmt.sbprintf(b, "[%d]", item.count)
render_type(b, result, item.child, record_names)
@@ -157,7 +161,7 @@ emit_records :: proc(b: ^strings.Builder, result: ^cimport.Result, record_names:
}
if !record.complete || len(record.reason) > 0 {
// opaque / pointer-only struct
fmt.sbprintf(b, "%s :: c_struct\n", name)
fmt.sbprintf(b, "%s :: opaque\n", name)
wrote = true
continue
}