Browse Source

fetch only zig

Trace Andreason 1 year ago
parent
commit
91cb0f9d58
2 changed files with 7 additions and 4 deletions
  1. 5 2
      bindgen/gen_all.py
  2. 2 2
      bindgen/gen_zig.py

+ 5 - 2
bindgen/gen_all.py

@@ -7,7 +7,6 @@ tasks = [
     [ '../sokol_glue.h',           'sglue_',    ['sg_'] ],
     [ '../sokol_time.h',           'stm_',      [] ],
     [ '../sokol_audio.h',          'saudio_',   [] ],
-    [ '../sokol_fetch.h',          'sfetch_',     [] ],
     [ '../util/sokol_gl.h',        'sgl_',      ['sg_'] ],
     [ '../util/sokol_debugtext.h', 'sdtx_',     ['sg_'] ],
     [ '../util/sokol_shape.h',     'sshape_',   ['sg_'] ],
@@ -26,8 +25,12 @@ for task in tasks:
     gen_nim.gen(c_header_path, main_prefix, dep_prefixes)
 
 # Zig
+zig_tasks = [
+    *tasks,
+    [ '../sokol_fetch.h', 'sfetch_', [] ],
+]
 gen_zig.prepare()
-for task in tasks:
+for task in zig_tasks:
     [c_header_path, main_prefix, dep_prefixes] = task
     gen_zig.gen(c_header_path, main_prefix, dep_prefixes)
 

+ 2 - 2
bindgen/gen_zig.py

@@ -62,8 +62,8 @@ overrides = {
     'sshape_element_range_t.num_elements':  'uint32_t',
     'sdtx_font.font_index':                 'uint32_t',
     'SGL_NO_ERROR':                         'SGL_ERROR_NO_ERROR',
-    'sfetch_continue':                      'fetch_continue', # 'fetch' is reserved in Zig
-    'sfetch_desc':                          'description'     # 'desc' shadowed by earlier definiton
+    'sfetch_continue':                      'continue_fetching',  # 'continue' is reserved in Zig
+    'sfetch_desc':                          'sfetch_get_desc'     # 'desc' shadowed by earlier definiton
 }
 
 prim_types = {