diff options
Diffstat (limited to 'cpp/src/Ice/DynamicLibrary.cpp')
-rw-r--r-- | cpp/src/Ice/DynamicLibrary.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp index c4a61b69695..ce407e6a91e 100644 --- a/cpp/src/Ice/DynamicLibrary.cpp +++ b/cpp/src/Ice/DynamicLibrary.cpp @@ -13,6 +13,7 @@ // ********************************************************************** #include <Ice/DynamicLibrary.h> +#include <IceUtil/Unicode.h> #ifndef _WIN32 # include <dlfcn.h> @@ -100,12 +101,13 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint) bool IceInternal::DynamicLibrary::load(const string& lib) { -#ifdef _WIN32
-#if _MSC_VER == 1200
- _hnd = LoadLibrary(lib.c_str());
-#else - _hnd = LoadLibrary((LPCWSTR)lib.c_str()); // Type changed in VC++ 2002
-#endif +#ifdef _WIN32 +# if _MSC_VER > 1200 + wstring wlib = IceUtil::stringToWstring(lib); + _hnd = LoadLibrary(wlib.c_str()); +# else + _hnd = LoadLibrary(lib.c_str()); +# endif #else _hnd = dlopen(lib.c_str(), RTLD_NOW); if(_hnd == 0) |