summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-10-31 13:33:07 +0800
committerGitHub <noreply@github.com>2022-10-31 06:33:07 +0100
commitfb2ec8d192cbaa36868f28275993936868ba2d31 (patch)
treece08a8f23fd44445f4ae43fff9ba86e348c4dbcf
parentf8b5464f31834bf97e7f9023644e255f2e9b6485 (diff)
downloadNim-fb2ec8d192cbaa36868f28275993936868ba2d31.tar.gz
follow up #20668; fixes nightlies (#20701)
-rw-r--r--lib/wrappers/openssl.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim
index dedea355c..9a4cb4121 100644
--- a/lib/wrappers/openssl.nim
+++ b/lib/wrappers/openssl.nim
@@ -331,6 +331,7 @@ when compileOption("dynlibOverride", "ssl") or defined(noOpenSSLHacks):
   proc SSLv23_client_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
   proc SSLv2_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
   proc SSLv3_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
+  proc CRYPTO_set_mem_functions(a,b,c: pointer){.cdecl, dynlib: DLLUtilName, importc.}
 
 else:
   # Here we're trying to stay compatible between openssl versions. Some
@@ -391,6 +392,10 @@ else:
     let method2Proc = cast[proc(): PSSL_METHOD {.cdecl, gcsafe, raises: [].}](methodSym)
     return method2Proc()
 
+  proc CRYPTO_set_mem_functions(a,b,c: pointer) =
+    let theProc = cast[proc(a,b,c: pointer) {.cdecl.}](utilModule().symNullable("CRYPTO_set_mem_functions"))
+    if not theProc.isNil: theProc(a, b, c)
+
   proc SSL_library_init*(): cint {.discardable.} =
     ## Initialize SSL using OPENSSL_init_ssl for OpenSSL >= 1.1.0 otherwise
     ## SSL_library_init
@@ -572,10 +577,6 @@ const
   useNimsAlloc = not defined(nimNoAllocForSSL) and not defined(gcDestructors)
 
 when not useWinVersion and not defined(macosx) and not defined(android) and useNimsAlloc:
-  proc CRYPTO_set_mem_functions(a,b,c: pointer) =
-    let theProc = cast[proc(a,b,c: pointer) {.cdecl.}](utilModule().symNullable("CRYPTO_set_mem_functions"))
-    if not theProc.isNil: theProc(a, b, c)
-
   proc allocWrapper(size: int): pointer {.cdecl.} = allocShared(size)
   proc reallocWrapper(p: pointer; newSize: int): pointer {.cdecl.} =
     if p == nil: