follow up #20668; fixes nightlies (#20701)

This commit is contained in:
ringabout
2022-10-31 13:33:07 +08:00
committed by GitHub
parent f8b5464f31
commit fb2ec8d192

View File

@@ -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: