// System dependent include
// ---------------------------------------------------------------------------
-#ifdef __UNIX__
+#if defined(__UNIX__)
#include <dlfcn.h>
#endif
wxLibrary::~wxLibrary()
{
if (m_handle && m_destroy) {
-#ifdef __UNIX__
+#if defined(__UNIX__)
dlclose(m_handle);
#endif
#ifdef __WINDOWS__
void *wxLibrary::GetSymbol(const wxString& symbname)
{
-#ifdef __UNIX__
+#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;
}
#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
while (node) {
obj = ((wxLibrary *)node->Data())->CreateObject(path);
- if (obj)
+ if (obj)
return obj;
node = node->Next();