patch 8.2.4524: MS-Windows: cannot build with some sodium libraries
Problem: MS-Windows: cannot build with some sodium libraries.
Solution: Make the DLL name configuragle. Add build instructions.
(Ken Takata, closes #9905)
diff --git a/src/crypt.c b/src/crypt.c
index d66e50c..86f4846 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -251,7 +251,7 @@
sodium_runtime_link_init(int verbose)
{
static HINSTANCE hsodium = NULL;
- const char *libname = "libsodium.dll";
+ const char *libname = DYNAMIC_SODIUM_DLL;
int i;
if (hsodium != NULL)
@@ -270,7 +270,7 @@
if ((*sodium_funcname_table[i].ptr = symbol_from_dll(hsodium,
sodium_funcname_table[i].name)) == NULL)
{
- FreeLibrary(hsodium);
+ close_dll(hsodium);
hsodium = NULL;
if (verbose)
semsg(_(e_could_not_load_library_function_str), sodium_funcname_table[i].name);