]> git.bitcoin.ninja Git - ldk-java/commitdiff
Disambiguate jcall function names by including the trait name
authorMatt Corallo <git@bluematt.me>
Sat, 20 Mar 2021 20:32:52 +0000 (16:32 -0400)
committerMatt Corallo <git@bluematt.me>
Sun, 21 Mar 2021 15:41:28 +0000 (11:41 -0400)
java_strings.py
typescript_strings.py

index 3f9ecc56f70efae855eb81d170d53f808643af74..eed7f398da0b326eaf6bae81e9a1fd6f90a234a8 100644 (file)
@@ -638,7 +638,7 @@ import java.util.Arrays;
         for idx, fn_line in enumerate(field_fns):
             if fn_line.fn_name != "free" and fn_line.fn_name != "clone":
                 assert fn_line.ret_ty_info.ty_info.get_full_rust_ty()[1] == ""
-                out_c = out_c + fn_line.ret_ty_info.ty_info.get_full_rust_ty()[0] + " " + fn_line.fn_name + "_jcall("
+                out_c = out_c + fn_line.ret_ty_info.ty_info.get_full_rust_ty()[0] + " " + fn_line.fn_name + "_" + struct_name + "_jcall("
                 if fn_line.self_is_const:
                     out_c = out_c + "const void* this_arg"
                 else:
@@ -714,7 +714,7 @@ import java.util.Arrays;
         out_c = out_c + "\t\t.this_arg = (void*) calls,\n"
         for fn_line in field_fns:
             if fn_line.fn_name != "free" and fn_line.fn_name != "clone":
-                out_c = out_c + "\t\t." + fn_line.fn_name + " = " + fn_line.fn_name + "_jcall,\n"
+                out_c = out_c + "\t\t." + fn_line.fn_name + " = " + fn_line.fn_name + "_" + struct_name + "_jcall,\n"
             elif fn_line.fn_name == "free":
                 out_c = out_c + "\t\t.free = " + struct_name + "_JCalls_free,\n"
             else:
index a3c706ecafc98bf22eb893c41eeb8cf53fcd69db..794f9ce1672a8516ee72b330e3d4eca134c6b9bb 100644 (file)
@@ -673,7 +673,7 @@ const decodeString = (stringPointer, free = true) => {
         for idx, fn_line in enumerate(field_function_lines):
             if fn_line.fn_name != "free" and fn_line.fn_name != "clone":
                 assert fn_line.ret_ty_info.ty_info.get_full_rust_ty()[1] == ""
-                out_c = out_c + fn_line.ret_ty_info.ty_info.get_full_rust_ty()[0] + " " + fn_line.fn_name + "_jcall("
+                out_c = out_c + fn_line.ret_ty_info.ty_info.get_full_rust_ty()[0] + " " + fn_line.fn_name + "_" + struct_name + "_jcall("
                 if fn_line.self_is_const:
                     out_c = out_c + "const void* this_arg"
                 else:
@@ -745,7 +745,7 @@ const decodeString = (stringPointer, free = true) => {
         out_c = out_c + "\t\t.this_arg = (void*) calls,\n"
         for fn_line in field_function_lines:
             if fn_line.fn_name != "free" and fn_line.fn_name != "clone":
-                out_c = out_c + "\t\t." + fn_line.fn_name + " = " + fn_line.fn_name + "_jcall,\n"
+                out_c = out_c + "\t\t." + fn_line.fn_name + " = " + fn_line.fn_name + "_" + struct_name + "_jcall,\n"
             elif fn_line.fn_name == "free":
                 out_c = out_c + "\t\t.free = " + struct_name + "_JCalls_free,\n"
             else: