vanzin commented on a change in pull request #94: Crypto 137 windows compile
URL: https://github.com/apache/commons-crypto/pull/94#discussion_r306087240
##########
File path: src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c
##########
@@ -41,27 +41,48 @@
#ifdef UNIX
static unsigned long (*dlsym_OpenSSL_version_num) (void);
static const char * (*dlsym_OpenSSL_version) (int);
-static void *openssl;
#endif
#ifdef WINDOWS
-typedef unsigned long (__cdecl *__dlsym_OpenSSL) (void);
-static __dlsym_OpenSSL dlsym_OpenSSL;
+typedef unsigned long (__cdecl *__dlsym_OpenSSL_version_num) (void);
typedef char * (__cdecl *__dlsym_OpenSSL_version) (int);
-static __dlsym_OpenSSL dlsym_OpenSSL;
+static __dlsym_OpenSSL_version_num dlsym_OpenSSL_version_num;
static __dlsym_OpenSSL_version dlsym_OpenSSL_version;
-HMODULE openssl;
#endif
+#ifdef UNIX
+static void get_methods(JNIEnv *env, void *openssl)
+#endif
+#ifdef WINDOWS
+static void get_methods(JNIEnv *env, HMODULE openssl)
+#endif
+{
+ LOAD_OPENSSL_VERSION_FUNCTION(dlsym_OpenSSL_version_num, env, openssl);
+#ifdef UNIX
+ if (dlsym_OpenSSL_version_num() > VERSION_1_1_X) {
+ LOAD_DYNAMIC_SYMBOL(dlsym_OpenSSL_version, env, openssl,
"OpenSSL_version");
Review comment:
2 vs. 4 space indent, here and in other places in this file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services