X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3897b707bd39c491c820849953431e4a5751fced..29149a64916d6fdc53e445adca9ef83bc58fb6c3:/src/common/dynlib.cpp diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 2c82172f8f..5c93399eee 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -98,6 +98,8 @@ const char *dlerror(void); # endif // Win32/16 # define wxDllGetSymbol(handle, name) ::GetProcAddress(handle, name) # define wxDllClose ::FreeLibrary +#elif defined(__WXMAC__) +# define wxDllClose(handle) CloseConnection(&handle) #else # error "Don't know how to load shared libraries on this platform." #endif // OS @@ -235,13 +237,13 @@ wxDllLoader::LoadLibrary(const wxString & libname, bool *success) Ptr myMainAddr ; Str255 myErrName ; - wxMacPathToFSSpec( libname , &myFSSpec ) ; + wxMacFilename2FSSpec( libname , &myFSSpec ) ; if (GetDiskFragment( &myFSSpec , 0 , kCFragGoesToEOF , "\p" , kPrivateCFragCopy , &handle , &myMainAddr , myErrName ) != noErr ) { p2cstr( myErrName ) ; - wxASSERT_MSG( 1 , (char*)myErrName ) ; - return NULL ; + wxLogSysError( _("Failed to load shared library '%s' Error '%s'") , libname.c_str() , (char*)myErrName ) ; + handle = NULL ; } #elif defined(__WXPM__) || defined(__EMX__) char zError[256] = ""; @@ -363,8 +365,7 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name) if (node != NULL) return ((wxLibrary *)node->Data()); #else // !OS/2 - node = m_loaded.Find(name.GetData()); - if ( node ) + if ( (node = m_loaded.Find(name.GetData())) != NULL) return ((wxLibrary *)node->Data()); #endif // If DLL shares data, this is necessary.