X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2FCppContainer.cxx;h=4b32ba08c915fd98918574a38b69cf94433b4a2e;hb=1b6e596efe9064e209170cd251c0ade5f22bd3db;hp=4366724d2a0e0eeca46f6fc8f549d102540d50ec;hpb=49d5f6f8af85a2d6398b05b9aa35552ffdfb74d4;p=modules%2Fyacs.git diff --git a/src/runtime/CppContainer.cxx b/src/runtime/CppContainer.cxx index 4366724d2..4b32ba08c 100644 --- a/src/runtime/CppContainer.cxx +++ b/src/runtime/CppContainer.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2006-2014 CEA/DEN, EDF R&D +// Copyright (C) 2006-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -126,7 +126,7 @@ bool CppContainer::loadComponentLibrary(const std::string & componentName) throw return false; } -CppComponent * CppContainer::createComponentInstance(const std::string & componentName, int /* studyID */) +CppComponent * CppContainer::createComponentInstance(const std::string & componentName) { DEBTRACE("CppContainer::createComponentInstance"); if (_trueCont) @@ -324,7 +324,11 @@ LocalLibrary LocalContainer::loadComponentLibrary(const std::string & aCompName } #ifndef WIN32 +#ifdef __APPLE__ + std::string impl_name = std::string ("lib") + aCompName + std::string("Local.dylib"); +#else std::string impl_name = std::string ("lib") + aCompName + std::string("Local.so"); +#endif if(sprefix != "") impl_name = sprefix + std::string("/") + impl_name; #else @@ -335,7 +339,15 @@ LocalLibrary LocalContainer::loadComponentLibrary(const std::string & aCompName #if defined( WIN32 ) HMODULE handle; - handle = dlopen( impl_name.c_str() ) ; +#if defined(UNICODE) + size_t length = strlen(impl_name.c_str()) + sizeof(char); + wchar_t* aPath = new wchar_t[length + 1]; + memset(aPath, '\0', length); + mbstowcs(aPath, impl_name.c_str(), length); +#else + const char* aPath = fullLibName.c_str(); +#endif + handle = dlopen( aPath ) ; #else void* handle; handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ;