diff options
| author | Andre Weissflog <floooh@gmail.com> | 2020-12-30 14:21:44 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2020-12-30 14:21:44 +0100 |
| commit | 790b28f7a8e863f15fc78e924277991b2d7fe2e6 (patch) | |
| tree | 294012129f698edcb956c8cf1726458dd58de73f /bindgen | |
| parent | a780b2f3bbce420e17d913da5b171c3bd95ac166 (diff) | |
bindgen: add sokol_audio.h
Diffstat (limited to 'bindgen')
| -rw-r--r-- | bindgen/gen_all.py | 3 | ||||
| -rw-r--r-- | bindgen/gen_zig.py | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/bindgen/gen_all.py b/bindgen/gen_all.py index 6cdcdd66..17929af6 100644 --- a/bindgen/gen_all.py +++ b/bindgen/gen_all.py @@ -3,7 +3,8 @@ import gen_ir, gen_zig tasks = [ [ '../sokol_gfx.h', 'sg_', 'gfx' ], [ '../sokol_app.h', 'sapp_', 'app' ], - [ '../sokol_time.h', 'stm_', 'time' ] + [ '../sokol_time.h', 'stm_', 'time' ], + [ '../sokol_audio.h', 'saudio_', 'audio' ] ] # Zig 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): |