瀏覽代碼

gen_zig.py: change to stage2 fnptr syntax

kcbanner 2 年之前
父節點
當前提交
94435a19ef
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      bindgen/gen_zig.py

+ 1 - 1
bindgen/gen_zig.py

@@ -328,7 +328,7 @@ def gen_struct(decl, prefix):
         elif is_const_prim_ptr(field_type):
             l(f"    {field_name}: ?[*]const {as_zig_prim_type(util.extract_ptr_type(field_type))} = null,")
         elif util.is_func_ptr(field_type):
-            l(f"    {field_name}: ?meta.FnPtr(fn({funcptr_args_c(field_type, prefix)}) callconv(.C) {funcptr_result_c(field_type)}) = null,")
+            l(f"    {field_name}: ?*const fn({funcptr_args_c(field_type, prefix)}) callconv(.C) {funcptr_result_c(field_type)} = null,")
         elif util.is_1d_array_type(field_type):
             array_type = util.extract_array_type(field_type)
             array_sizes = util.extract_array_sizes(field_type)