diff options
Diffstat (limited to 'cpp/src/Ice/DynamicLibrary.cpp')
-rw-r--r-- | cpp/src/Ice/DynamicLibrary.cpp | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp index 714e042a9a5..d70e14bd74a 100644 --- a/cpp/src/Ice/DynamicLibrary.cpp +++ b/cpp/src/Ice/DynamicLibrary.cpp @@ -9,7 +9,7 @@ #include <Ice/DynamicLibrary.h> #include <IceUtil/StringUtil.h> -#include <IceUtil/StringConverter.h> +#include <Ice/StringConverter.h> #ifndef _WIN32 # include <dlfcn.h> @@ -26,7 +26,7 @@ using namespace std; IceUtil::Shared* IceInternal::upCast(DynamicLibrary* p) { return p; } IceUtil::Shared* IceInternal::upCast(DynamicLibraryList* p) { return p; } -IceInternal::DynamicLibrary::DynamicLibrary() : +IceInternal::DynamicLibrary::DynamicLibrary() : _hnd(0) { } @@ -93,24 +93,23 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc if(comma == string::npos) { libName = libSpec; -# ifdef ICE_LIBSUFFIX - libName += ICE_LIBSUFFIX; +# if defined(ICE_CPP11_MAPPING) && !defined(_WIN32) + libName += "++11"; # endif if(useIceVersion) { int majorVersion = (ICE_INT_VERSION / 10000); int minorVersion = (ICE_INT_VERSION / 100) - majorVersion * 100; + int patchVersion = ICE_INT_VERSION % 100; ostringstream os; os << majorVersion * 10 + minorVersion; - - int patchVersion = ICE_INT_VERSION % 100; - if(patchVersion > 50) + if(patchVersion >= 60) { - os << 'b'; - if(patchVersion >= 52) - { - os << (patchVersion - 50); - } + os << 'b' << (patchVersion - 60); + } + else if(patchVersion >= 50) + { + os << 'a' << (patchVersion - 50); } version = os.str(); } @@ -123,9 +122,9 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc return 0; } libName = libSpec.substr(0, comma); -#ifdef ICE_LIBSUFFIX - libName += ICE_LIBSUFFIX; -#endif +# if defined(ICE_CPP11_MAPPING) && !defined(_WIN32) + libName += "++11"; +# endif version = libSpec.substr(comma + 1); } @@ -134,6 +133,13 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc #ifdef _WIN32 lib += libName; lib += version; +# ifdef ICE_OS_WINRT + lib += "uwp"; +# endif + +# ifdef ICE_CPP11_MAPPING + lib += "++11"; +# endif # if defined(_DEBUG) && !defined(__MINGW32__) lib += 'd'; @@ -212,9 +218,9 @@ IceInternal::DynamicLibrary::load(const string& lib) // to Windows API. // #ifdef ICE_OS_WINRT - _hnd = LoadPackagedLibrary(IceUtil::stringToWstring(lib, IceUtil::getProcessStringConverter()).c_str(), 0); + _hnd = LoadPackagedLibrary(stringToWstring(lib, getProcessStringConverter()).c_str(), 0); #elif defined(_WIN32) - _hnd = LoadLibraryW(IceUtil::stringToWstring(lib, IceUtil::getProcessStringConverter()).c_str()); + _hnd = LoadLibraryW(stringToWstring(lib, getProcessStringConverter()).c_str()); #else int flags = RTLD_NOW | RTLD_GLOBAL; @@ -277,9 +283,13 @@ IceInternal::DynamicLibrary::getErrorMessage() const return _err; } +IceInternal::DynamicLibraryList::~DynamicLibraryList() +{ + // Out of line to avoid weak vtable +} + void IceInternal::DynamicLibraryList::add(const DynamicLibraryPtr& library) { _libraries.push_back(library); } - |