ソースを参照

add support to gen_zig.py for function pointers that return primitive types

Daniel Hooper 2 年 前
コミット
cac5fa5ee4
1 ファイル変更2 行追加0 行削除
  1. 2 0
      bindgen/gen_zig.py

+ 2 - 0
bindgen/gen_zig.py

@@ -271,6 +271,8 @@ def funcptr_result_c(field_type):
     res_type = field_type[:field_type.index('(*)')].strip()
     res_type = field_type[:field_type.index('(*)')].strip()
     if res_type == 'void':
     if res_type == 'void':
         return 'void'
         return 'void'
+    elif is_prim_type(res_type):
+        return as_zig_prim_type(res_type)
     elif util.is_const_void_ptr(res_type):
     elif util.is_const_void_ptr(res_type):
         return '?*const anyopaque'
         return '?*const anyopaque'
     elif util.is_void_ptr(res_type):
     elif util.is_void_ptr(res_type):