X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_HypothesesUtils.cxx;h=ebb1ca33341cb34caad8ffcff5f6acd561930ffd;hp=556dc5591ffda71982444351eefd0765be1905b0;hb=9d11375af40826e967ab2c3bcb77d1f9d439c90c;hpb=57b43b4d010e2d0a1529d3c131bbb9d416e63258 diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 556dc5591..ebb1ca333 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESHGUI_HypothesesUtils.h" @@ -47,7 +47,23 @@ #include #include -#include +#ifdef WNT + #include +#else + #include +#endif + +#ifdef WNT + #define LibHandle HMODULE + #define LoadLib( name ) LoadLibrary( name ) + #define GetProc GetProcAddress + #define UnLoadLib( handle ) FreeLibrary( handle ); +#else + #define LibHandle void* + #define LoadLib( name ) dlopen( name, RTLD_LAZY ) + #define GetProc dlsym + #define UnLoadLib( handle ) dlclose( handle ); +#endif #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -320,11 +336,18 @@ namespace SMESH{ try { // load plugin library if(MYDEBUG) MESSAGE("Loading client meshers plugin library ..."); - void* libHandle = dlopen (aClientLibName, RTLD_LAZY); + LibHandle libHandle = LoadLib( aClientLibName ); if (!libHandle) { // report any error, if occured - const char* anError = dlerror(); - if(MYDEBUG) MESSAGE(anError); + if ( MYDEBUG ) + { +#ifdef WIN32 + const char* anError = "Can't load client meshers plugin library"; +#else + const char* anError = dlerror(); +#endif + MESSAGE(anError); + } } else { // get method, returning hypothesis creator @@ -332,10 +355,10 @@ namespace SMESH{ typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \ ( const QString& ); GetHypothesisCreator procHandle = - (GetHypothesisCreator)dlsym(libHandle, "GetHypothesisCreator"); + (GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator"); if (!procHandle) { if(MYDEBUG) MESSAGE("bad hypothesis client plugin library"); - dlclose(libHandle); + UnLoadLib(libHandle); } else { // get hypothesis creator @@ -594,6 +617,7 @@ namespace SMESH{ CASE2MESSAGE( MISSING_ALGO ); CASE2MESSAGE( MISSING_HYPO ); CASE2MESSAGE( NOT_CONFORM_MESH ); + CASE2MESSAGE( BAD_PARAM_VALUE ); default: continue; } // apply args to message: