This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch crypto-174
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/crypto-174 by this push:
     new 9b296ac4 Update DynamicLoader.c
9b296ac4 is described below

commit 9b296ac4eb8419166750cfdd42cf645665044168
Author: sebbASF <[email protected]>
AuthorDate: Sun Nov 5 09:40:24 2023 +0000

    Update DynamicLoader.c
    
    Must be correct type [skip ci]
---
 src/main/native/org/apache/commons/crypto/DynamicLoader.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/native/org/apache/commons/crypto/DynamicLoader.c 
b/src/main/native/org/apache/commons/crypto/DynamicLoader.c
index 8e2d0fff..0614abea 100644
--- a/src/main/native/org/apache/commons/crypto/DynamicLoader.c
+++ b/src/main/native/org/apache/commons/crypto/DynamicLoader.c
@@ -27,7 +27,11 @@ HMODULE open_library(JNIEnv *env)
 
 {
   if (!openssl) {
-    const char *libraryPath = COMMONS_CRYPTO_OPENSSL_LIBRARY;
+#ifdef WINDOWS
+    TCHAR libraryPath = COMMONS_CRYPTO_OPENSSL_LIBRARY;
+#else
+    char *libraryPath = COMMONS_CRYPTO_OPENSSL_LIBRARY;
+#endif
     jclass clazz = (*env)->FindClass(env, 
"org/apache/commons/crypto/utils/Utils");
     if (clazz) {
         jmethodID libraryPathFunc = (*env)->GetStaticMethodID(env, clazz, 
"libraryPath", "(Ljava/lang/String;)Ljava/lang/String;");
@@ -44,7 +48,7 @@ HMODULE open_library(JNIEnv *env)
 #endif
 
 #ifdef WINDOWS
-    openssl = LoadLibrary(TEXT("libcrypto-1_1-x64.dll"));
+    openssl = LoadLibrary(libraryPath);
 #endif
 
   }

Reply via email to