From 1a3e5747b7df7ddda312bbfd18e04fc2122001fb Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Sat, 24 Jul 2021 13:57:29 +0200 Subject: 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 #8621) --- src/if_tcl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/if_tcl.c') diff --git a/src/if_tcl.c b/src/if_tcl.c index c3b9c5bbe..f3f4b0798 100644 --- a/src/if_tcl.c +++ b/src/if_tcl.c @@ -167,11 +167,13 @@ typedef int HANDLE; # 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 TCL_PROC FARPROC # define load_dll vimLoadLib # define symbol_from_dll GetProcAddress # define close_dll FreeLibrary +# define load_dll_error GetWin32Error # endif /* @@ -213,7 +215,7 @@ tcl_runtime_link_init(char *libname, int verbose) if (!(hTclLib = load_dll(libname))) { if (verbose) - semsg(_(e_loadlib), libname); + semsg(_(e_loadlib), libname, load_dll_error()); return FAIL; } for (i = 0; tcl_funcname_table[i].ptr; ++i) -- cgit v1.2.1