From 79490aa574fa7ae1501d1ff31d0903694fab323d Mon Sep 17 00:00:00 2001 From: hev Date: Tue, 19 Nov 2024 22:26:41 +0800 Subject: [PATCH] HevJNI: Declare CLSNAME to allow overriding the class name. --- src/hev-jni.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hev-jni.c b/src/hev-jni.c index c4926ce..ca2caa2 100644 --- a/src/hev-jni.c +++ b/src/hev-jni.c @@ -25,6 +25,9 @@ #ifndef PKGNAME #define PKGNAME hev/htproxy #endif +#ifndef CLSNAME +#define CLSNAME TProxyService +#endif /* clang-format on */ #define STR(s) STR_ARG (s) @@ -73,7 +76,7 @@ JNI_OnLoad (JavaVM *vm, void *reserved) return 0; } - klass = (*env)->FindClass (env, STR (PKGNAME) "/TProxyService"); + klass = (*env)->FindClass (env, STR (PKGNAME) "/" STR (CLSNAME)); (*env)->RegisterNatives (env, klass, native_methods, N_ELEMENTS (native_methods)); (*env)->DeleteLocalRef (env, klass);