git » sdk » commit f515886

Array, not pointer to array

author Stephen Paul Weber
2026-01-12 20:38:08 UTC
committer Stephen Paul Weber
2026-01-12 20:38:08 UTC
parent 93050faede45d5f1b4a74f193e99eb9c90d81e16

Array, not pointer to array

HaxeCBridge.hx +6 -1

diff --git a/HaxeCBridge.hx b/HaxeCBridge.hx
index 9cbb072..65359f5 100644
--- a/HaxeCBridge.hx
+++ b/HaxeCBridge.hx
@@ -397,7 +397,12 @@ class HaxeCBridge {
 							kind: FFun({ret: TPath({name: "SizeT", pack: ["cpp"]}), params: [], args: [{name: "outPtr", type: ptrT}], expr: macro { final x = $i{field.name}; if (outPtr != null) { cpp.Pointer.fromRaw(outPtr).set_ref(x); } return x.length; } })
 						});
 						if (!field.access.contains(AFinal)) {
-							final cptrT = TPath({name: "ConstPointer", pack: ["cpp"], params: [TPType(convertedType.args[0])]});
+							final cptrT = switch (convertedType.args[0]) {
+								case TPath(tp):
+									TPath({name: "ConstPointer", pack: ["cpp"], params: tp.params});
+								default:
+									throw "Unsupported array type";
+							}
 							fields.insert(insertTo, {
 								name: "set_" + field.name + "__fromC",
 								doc: field.doc,