]> git.bitcoin.ninja Git - ldk-java/commitdiff
Handle uintptr_t slightly better in C conversion
authorMatt Corallo <git@bluematt.me>
Mon, 25 Jan 2021 22:45:22 +0000 (17:45 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 25 Jan 2021 22:46:08 +0000 (17:46 -0500)
genbindings.py

index f47cce3699d823ab2f972ba47e161f2d69791fef..32cad50a7480adebd50e43b81c12544a45b06c2c 100755 (executable)
@@ -216,11 +216,12 @@ def java_c_types(fn_arg, ret_arr_len):
         # TODO: uintptr_t is arch-dependent :(
         mapped_type = consts.c_type_map['uint64_t']
         java_ty = mapped_type[0]
-        c_ty = "int64_t"
         fn_ty_arg = "J"
         if fn_arg.startswith("uint64_t"):
+            c_ty = "int64_t"
             fn_arg = fn_arg[8:].strip()
         else:
+            c_ty = "intptr_t"
             fn_arg = fn_arg[9:].strip()
         is_primitive = True
     elif is_const and fn_arg.startswith("char *"):