diff src/if_lua.c @ 25342:c4298ed56ffa v8.2.3208

patch 8.2.3208: dynamic library load error does not mention why it failed Commit: https://github.com/vim/vim/commit/1a3e5747b7df7ddda312bbfd18e04fc2122001fb Author: Martin Tournoij <martin@arp242.net> Date: Sat Jul 24 13:57:29 2021 +0200 patch 8.2.3208: dynamic library load error does not mention why it failed Problem: Dynamic library load error does not mention why it failed. Solution: Add the error message. (Martin Tournoij, closes https://github.com/vim/vim/issues/8621)
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Jul 2021 14:00:05 +0200
parents 0878f0fd349b
children 3a8b61b31724
line wrap: on
line diff
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -105,10 +105,12 @@ static void luaV_call_lua_func_free(void
 # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
 # define symbol_from_dll dlsym
 # define close_dll dlclose
+# define load_dll_error dlerror
 #else
 # define load_dll vimLoadLib
 # define symbol_from_dll GetProcAddress
 # define close_dll FreeLibrary
+# define load_dll_error GetWin32Error
 #endif
 
 // lauxlib
@@ -446,7 +448,7 @@ lua_link_init(char *libname, int verbose
     if (!hinstLua)
     {
 	if (verbose)
-	    semsg(_(e_loadlib), libname);
+	    semsg(_(e_loadlib), libname, load_dll_error());
 	return FAIL;
     }
     for (reg = luaV_dll; reg->func; reg++)