Skip to content

Commit

Permalink
HevJNI: Declare CLSNAME to allow overriding the class name.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed Nov 19, 2024
1 parent 6ff2c49 commit 1be6a3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hev-jni.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#ifndef PKGNAME
#define PKGNAME hev/socks5
#endif
#ifndef CLSNAME
#define CLSNAME Socks5Service
#endif
/* clang-format on */

#define STR(s) STR_ARG (s)
Expand Down Expand Up @@ -70,7 +73,7 @@ JNI_OnLoad (JavaVM *vm, void *reserved)
return 0;
}

klass = (*env)->FindClass (env, STR (PKGNAME) "/Socks5Service");
klass = (*env)->FindClass (env, STR (PKGNAME) "/" STR (CLSNAME));
(*env)->RegisterNatives (env, klass, native_methods,
N_ELEMENTS (native_methods));
(*env)->DeleteLocalRef (env, klass);
Expand Down

0 comments on commit 1be6a3c

Please sign in to comment.