aboutsummaryrefslogtreecommitdiff
path: root/bindgen/gen_zig.py
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2020-12-30 14:21:44 +0100
committerAndre Weissflog <floooh@gmail.com>2020-12-30 14:21:44 +0100
commit790b28f7a8e863f15fc78e924277991b2d7fe2e6 (patch)
tree294012129f698edcb956c8cf1726458dd58de73f /bindgen/gen_zig.py
parenta780b2f3bbce420e17d913da5b171c3bd95ac166 (diff)
bindgen: add sokol_audio.h
Diffstat (limited to 'bindgen/gen_zig.py')
-rw-r--r--bindgen/gen_zig.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bindgen/gen_zig.py b/bindgen/gen_zig.py
index 2750dd99..9dcc46fe 100644
--- a/bindgen/gen_zig.py
+++ b/bindgen/gen_zig.py
@@ -196,8 +196,10 @@ def as_extern_c_arg_type(arg_type):
return f"[*c]const {as_title_case(extract_ptr_type(arg_type))}"
elif is_prim_ptr(arg_type):
return f"[*c] {as_zig_prim_type(extract_ptr_type(arg_type))}"
+ elif is_const_prim_ptr(arg_type):
+ return f"[*c]const {as_zig_prim_type(extract_ptr_type(arg_type))}"
else:
- return '???'
+ return '??? (as_extern_c_arg_type)'
def as_zig_arg_type(arg_prefix, arg_type):
# NOTE: if arg_prefix is None, the result is used as return value
@@ -224,8 +226,10 @@ def as_zig_arg_type(arg_prefix, arg_type):
return pre + f"{as_title_case(extract_ptr_type(arg_type))}"
elif is_prim_ptr(arg_type):
return pre + f"* {as_zig_prim_type(extract_ptr_type(arg_type))}"
+ elif is_const_prim_ptr(arg_type):
+ return pre + f"*const {as_zig_prim_type(extract_ptr_type(arg_type))}"
else:
- return arg_prefix + "???"
+ return arg_prefix + "??? (as_zig_arg_type)"
# get C-style arguments of a function pointer as string
def funcptr_args_c(field_type):