diff options
author | Bernard Normier <bernard@zeroc.com> | 2019-06-24 15:37:49 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2019-06-24 15:37:49 -0400 |
commit | 8350a77f7f7f1d83ffce5b1c2db6a9390b33928a (patch) | |
tree | 001020271a525392a83d11084cc80fd18d9d2832 /cpp/src/Ice/DynamicLibrary.cpp | |
parent | Fix checkedCast with facet and MATLAB - Close #394 (diff) | |
download | ice-8350a77f7f7f1d83ffce5b1c2db6a9390b33928a.tar.bz2 ice-8350a77f7f7f1d83ffce5b1c2db6a9390b33928a.tar.xz ice-8350a77f7f7f1d83ffce5b1c2db6a9390b33928a.zip |
Better error message for LoadLibrary failure on Windows.
Fixes #355.
Diffstat (limited to 'cpp/src/Ice/DynamicLibrary.cpp')
-rw-r--r-- | cpp/src/Ice/DynamicLibrary.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp index 3fac7e6ecfe..5685d1bfa3f 100644 --- a/cpp/src/Ice/DynamicLibrary.cpp +++ b/cpp/src/Ice/DynamicLibrary.cpp @@ -212,12 +212,11 @@ IceInternal::DynamicLibrary::load(const string& lib) // Don't need to use a wide string converter as the wide string is passed // to Windows API. // -#ifdef ICE_OS_UWP +#if defined(ICE_OS_UWP) _hnd = LoadPackagedLibrary(stringToWstring(lib, getProcessStringConverter()).c_str(), 0); #elif defined(_WIN32) _hnd = LoadLibraryW(stringToWstring(lib, getProcessStringConverter()).c_str()); #else - int flags = RTLD_NOW | RTLD_GLOBAL; #ifdef _AIX flags |= RTLD_MEMBER; @@ -230,8 +229,10 @@ IceInternal::DynamicLibrary::load(const string& lib) // // Remember the most recent error in _err. // -#ifdef _WIN32 - _err = IceUtilInternal::lastErrorToString(); +#if defined(ICE_OS_UWP) + _err = "LoadPackagedLibrary on `" + lib + "' failed with `" + IceUtilInternal::lastErrorToString() + "'"; +#elif defined(_WIN32) + _err = "LoadLibraryW on `" + lib + "' failed with `" + IceUtilInternal::lastErrorToString() + "'"; #else const char* err = dlerror(); if(err) @@ -260,7 +261,7 @@ IceInternal::DynamicLibrary::getSymbol(const string& name) // Remember the most recent error in _err. // #ifdef _WIN32 - _err = IceUtilInternal::lastErrorToString(); + _err = "GetProcAddress for `" + name + "' failed with `" + IceUtilInternal::lastErrorToString() + "'"; #else const char* err = dlerror(); if(err) |