2
0
Эх сурвалжийг харах

add asRange helper to fetch binding generation

Trace Andreason 1 жил өмнө
parent
commit
94d6e253b5

+ 1 - 1
bindgen/gen_zig.py

@@ -460,7 +460,7 @@ def gen_helpers(inp):
     l('fn cStrToZig(c_str: [*c]const u8) [:0]const u8 {')
     l('fn cStrToZig(c_str: [*c]const u8) [:0]const u8 {')
     l('    return @import("std").mem.span(c_str);')
     l('    return @import("std").mem.span(c_str);')
     l('}')
     l('}')
-    if inp['prefix'] in ['sg_', 'sdtx_', 'sshape_']:
+    if inp['prefix'] in ['sg_', 'sdtx_', 'sshape_', 'sfetch_']:
         l('// helper function to convert "anything" to a Range struct')
         l('// helper function to convert "anything" to a Range struct')
         l('pub fn asRange(val: anytype) Range {')
         l('pub fn asRange(val: anytype) Range {')
         l('    const type_info = @typeInfo(@TypeOf(val));')
         l('    const type_info = @typeInfo(@TypeOf(val));')