From ffe3690a2af1f8a8280ccdf705664ae30ee7ef33 Mon Sep 17 00:00:00 2001 From: Barinzaya Date: Tue, 19 Nov 2024 10:06:08 -0500 Subject: [PATCH] Fixed Allocator function argument type in helpers. This corresponds to a change in the bindgen mappings, see floooh/sokol#1157 and floooh/sokol#1158, except this function is not automatically generated. --- sokol/helpers/allocator.odin | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sokol/helpers/allocator.odin b/sokol/helpers/allocator.odin index 5a9995d..10e1aa4 100644 --- a/sokol/helpers/allocator.odin +++ b/sokol/helpers/allocator.odin @@ -5,9 +5,10 @@ package sokol_helpers import sapp "../app" import sg "../gfx" import "base:runtime" +import "core:c" Allocator :: struct { - alloc_fn: proc "c" (size: u64, user_data: rawptr) -> rawptr, + alloc_fn: proc "c" (size: c.size_t, user_data: rawptr) -> rawptr, free_fn: proc "c" (ptr: rawptr, user_data: rawptr), user_data: rawptr, } @@ -22,7 +23,7 @@ allocator :: proc(context_ptr: ^runtime.Context) -> Allocator { } } -allocator_alloc_proc :: proc "c" (size: u64, user_data: rawptr) -> rawptr { +allocator_alloc_proc :: proc "c" (size: c.size_t, user_data: rawptr) -> rawptr { context = (cast(^runtime.Context)user_data)^ bytes, err := runtime.mem_alloc(size = int(size)) if err != nil {