comparison src/crypt.c @ 27998:ef7d9789919d v8.2.4524

patch 8.2.4524: MS-Windows: cannot build with some sodium libraries Commit: https://github.com/vim/vim/commit/d8f8629b1bf566e1dada7515e9b146c69e5d9757 Author: K.Takata <kentkt@csc.jp> Date: Mon Mar 7 15:16:15 2022 +0000 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 07 Mar 2022 16:30:04 +0100
parents a077948be0f4
children 4dcccb2673fe
comparison
equal deleted inserted replaced
27997:ceb745137863 27998:ef7d9789919d
249 249
250 static int 250 static int
251 sodium_runtime_link_init(int verbose) 251 sodium_runtime_link_init(int verbose)
252 { 252 {
253 static HINSTANCE hsodium = NULL; 253 static HINSTANCE hsodium = NULL;
254 const char *libname = "libsodium.dll"; 254 const char *libname = DYNAMIC_SODIUM_DLL;
255 int i; 255 int i;
256 256
257 if (hsodium != NULL) 257 if (hsodium != NULL)
258 return OK; 258 return OK;
259 259
268 for (i = 0; sodium_funcname_table[i].ptr; ++i) 268 for (i = 0; sodium_funcname_table[i].ptr; ++i)
269 { 269 {
270 if ((*sodium_funcname_table[i].ptr = symbol_from_dll(hsodium, 270 if ((*sodium_funcname_table[i].ptr = symbol_from_dll(hsodium,
271 sodium_funcname_table[i].name)) == NULL) 271 sodium_funcname_table[i].name)) == NULL)
272 { 272 {
273 FreeLibrary(hsodium); 273 close_dll(hsodium);
274 hsodium = NULL; 274 hsodium = NULL;
275 if (verbose) 275 if (verbose)
276 semsg(_(e_could_not_load_library_function_str), sodium_funcname_table[i].name); 276 semsg(_(e_could_not_load_library_function_str), sodium_funcname_table[i].name);
277 return FAIL; 277 return FAIL;
278 } 278 }