From fe00cc320396bc7ac301a22592b718792ae49adf Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 12 Jan 2015 16:38:48 +0100 Subject: Added detailed error message when a plugin fails to load - This helps figuring out why a plugin can't be loaded (especially on linux systems.) - Special thanks to Dastgir. Signed-off-by: Haru --- src/common/HPM.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common/HPM.h') diff --git a/src/common/HPM.h b/src/common/HPM.h index 4e1aa5beb..973bc6cca 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -19,6 +19,7 @@ #define plugin_open(x) LoadLibraryA(x) #define plugin_import(x,y,z) (z)GetProcAddress((x),(y)) #define plugin_close(x) FreeLibrary(x) + #define plugin_geterror(buf) (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, buf, sizeof(buf), NULL) ? buf : "Unknown error") #define DLL_EXT ".dll" #define DLL HINSTANCE @@ -31,6 +32,7 @@ #endif // RTLD_DEEPBIND #define plugin_import(x,y,z) (z)dlsym((x),(y)) #define plugin_close(x) dlclose(x) + #define plugin_geterror(buf) ((void)buf, dlerror()) #if defined CYGWIN #define DLL_EXT ".dll" -- cgit v1.2.3-70-g09d2