allocator interface (first pass)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user