From b0ba503b308bcdcbf1b7609876705c12408e44e6 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 17 Jan 2022 02:50:23 +0000 Subject: [PATCH] Use intptr_t in C when talking about a pointer. This fixes a bug in TS where we'd return an int64_t when we intended to return a pointer, confusing JavaScript as to why it has a bigint instead of a number. This may make it harder to support 32-bit Java platforms in the future if we have a reason to do so, but that seems unlikely and its possible we can simply redefine the type. --- genbindings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genbindings.py b/genbindings.py index 8b067f72..175340d6 100755 --- a/genbindings.py +++ b/genbindings.py @@ -288,7 +288,7 @@ def java_c_types(fn_arg, ret_arr_len): fn_arg = fn_arg[8:].strip() else: java_ty = consts.ptr_native_ty - c_ty = "int64_t" + c_ty = "intptr_t" arr_ty = "uintptr_t" rust_obj = "uintptr_t" fn_arg = fn_arg[9:].strip() -- 2.30.2