]> git.bitcoin.ninja Git - ldk-java/commitdiff
Add handling for signed int64 type
authorMatt Corallo <git@bluematt.me>
Thu, 27 Jul 2023 20:34:49 +0000 (20:34 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 30 Jul 2023 04:50:23 +0000 (04:50 +0000)
genbindings.py
java_strings.py
typescript_strings.py

index c11cd823ac14100f63533e246a1a06438f326fb0..e8ddb657141938b5bf8321c452548b295f0cb821 100755 (executable)
@@ -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']
index d903cddfb859bfcfedeae07cefa44adf35f1fa1a..d12237fe8a4bbbc4ca75dfdab45ce3bad610a5e2 100644 (file)
@@ -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"
index 54b507427f6b76d051192aa7bb2d877bed446bed..82c3fa0cb934a8e49f59267edf3b6b73dac979d9 100644 (file)
@@ -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(