fix bug in sci_dlsym function 02/18702/3
Antoine ELIAS [Mon, 21 Nov 2016 14:25:28 +0000 (15:25 +0100)]
Change-Id: I8a4531bc6324de261b206aea3de032411cea0c76

scilab/modules/dynamic_link/src/cpp/dynamic_link.cpp

index 986d2d6..da17cdc 100644 (file)
@@ -201,7 +201,7 @@ int Sci_dlsym(wchar_t* _pwstEntryPointName, int _iLibID, BOOL _bFortran)
     }
 
     /** entry was previously loaded **/
-    if (ConfigVariable::getEntryPoint(_pwstEntryPointName, _iLibID) != NULL)
+    if (ConfigVariable::getEntryPoint(pwstEntryPointName, _iLibID) != NULL)
     {
         sciprint(_("Entry name %ls.\n"), _pwstEntryPointName);
         FREE(pwstEntryPointName);
@@ -211,13 +211,9 @@ int Sci_dlsym(wchar_t* _pwstEntryPointName, int _iLibID, BOOL _bFortran)
 
     pEP->iLibIndex = _iLibID;
     hDynLib = (DynLibHandle)  ConfigVariable::getDynamicLibrary(_iLibID)->hLib;
-#ifdef _MCS_VER
-    pEP->functionPtr = (function) GetDynLibFuncPtrW(hDynLib, pwstEntryPointName);
-#else
     char* pstEntryPointName = wide_string_to_UTF8(pwstEntryPointName);
     pEP->functionPtr = (function) GetDynLibFuncPtr(hDynLib, pstEntryPointName);
     FREE(pstEntryPointName);
-#endif
     if (pEP->functionPtr == NULL)
     {
         if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT)