X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9e4b2f1c571dc79da7c9b3ceb23fcc941e4f0ef8..cfad3750c3ecc821ffae8b9b3de852551270846d:/src/common/dynlib.cpp diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 91f3c16577..6b8bf78e38 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -117,9 +117,20 @@ void *wxLibrary::GetSymbol(const wxString& symbname) { #if defined(__UNIX__) return dlsym(m_handle, WXSTRINGCAST symbname); -#endif -#ifdef __WINDOWS__ +#elif defined( __WINDOWS__ ) return GetProcAddress((HINSTANCE) m_handle, WXSTRINGCAST symbname); +#elif defined( __WXMAC__ ) + Ptr symAddress ; + CFragSymbolClass symClass ; + Str255 symName ; + + strcpy( (char*) symName , symbname ) ; + c2pstr( (char*) symName ) ; + + if ( FindSymbol( (CFragConnectionID) m_handle , symName , &symAddress , &symClass ) == noErr ) + { + return symAddress ; + } #endif return NULL; } @@ -175,11 +186,29 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name) #ifdef UNICODE HMODULE handle = LoadLibraryW(lib_name); +#else +#ifdef __WIN16__ + HMODULE handle = ::LoadLibrary(lib_name); #else HMODULE handle = LoadLibraryA(lib_name); +#endif #endif if (!handle) return NULL; +#elif defined(__WXMAC__) + FSSpec myFSSpec ; + CFragConnectionID handle ; + Ptr myMainAddr ; + Str255 myErrName ; + + wxMacPathToFSSpec( lib_name , &myFSSpec ) ; + if (GetDiskFragment( &myFSSpec , 0 , kCFragGoesToEOF , "\p" , kPrivateCFragCopy , &handle , &myMainAddr , + myErrName ) != noErr ) + { + p2cstr( myErrName ) ; + wxASSERT_MSG( 1 , (char*)myErrName ) ; + return NULL ; + } #else return NULL; #endif