From: Matt Corallo Date: Thu, 27 Jul 2023 20:34:49 +0000 (+0000) Subject: Add handling for signed int64 type X-Git-Tag: v0.0.116.0^2~8 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=7da1092518e5ea1518255a4473c178f52549fd81;p=ldk-java Add handling for signed int64 type --- diff --git a/genbindings.py b/genbindings.py index c11cd823..e8ddb657 100755 --- a/genbindings.py +++ b/genbindings.py @@ -326,6 +326,14 @@ def java_c_types(fn_arg, ret_arr_len): fn_ty_arg = "I" fn_arg = fn_arg[8:].strip() is_primitive = True + elif fn_arg.startswith("int64_t"): + mapped_type = consts.c_type_map['int64_t'] + java_ty = mapped_type[0] + c_ty = "int64_t" + arr_ty = "int64_t" + fn_ty_arg = "J" + fn_arg = fn_arg[7:].strip() + is_primitive = True elif fn_arg.startswith("uint64_t") or fn_arg.startswith("uintptr_t"): # TODO: uintptr_t is arch-dependent :( mapped_type = consts.c_type_map['uint64_t'] diff --git a/java_strings.py b/java_strings.py index d903cddf..d12237fe 100644 --- a/java_strings.py +++ b/java_strings.py @@ -17,6 +17,7 @@ class Consts: uint16_t = ['short'], uint32_t = ['int'], uint64_t = ['long'], + int64_t = ['long'], ) self.java_type_map = dict( String = "String" diff --git a/typescript_strings.py b/typescript_strings.py index 54b50742..82c3fa0c 100644 --- a/typescript_strings.py +++ b/typescript_strings.py @@ -21,6 +21,7 @@ class Consts: uint8_t = ['number', 'number', 'Uint8Array'], uint16_t = ['number', 'number', 'Uint16Array'], uint32_t = ['number', 'number', 'Uint32Array'], + int64_t = ['bigint', 'bigint', 'BigInt64Array'], uint64_t = ['bigint', 'bigint', 'BigUint64Array'], ) self.java_type_map = dict(