+
+#elif defined(__WXPM__) || defined(__EMX__)
+ char zError[256] = "";
+ wxDllOpen(zError, libname, handle);
+
+#else
+ handle = wxDllOpen(libname);
+
+#endif
+
+ if ( !handle )
+ {
+ wxString msg(_("Failed to load shared library '%s'"));
+
+#ifdef HAVE_DLERROR
+ const wxChar *err = dlerror();
+ if( err )
+ {
+ failed = TRUE;
+ wxLogError( msg, err );
+ }
+#else
+ failed = TRUE;
+ wxLogSysError( msg, libname.c_str() );
+#endif
+ }
+
+ if ( success )
+ *success = !failed;
+
+ return handle;
+}
+
+
+/* static */
+void wxDllLoader::UnloadLibrary(wxDllType handle)
+{
+ wxDllClose(handle);
+}
+
+/* static */
+void *wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *success)
+{
+ bool failed = FALSE;
+ void *symbol = 0;
+
+#if defined(__WXMAC__) && !defined(__UNIX__)
+ Ptr symAddress;
+ CFragSymbolClass symClass;
+ Str255 symName;
+
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) symName, name );
+#else
+ strcpy( (char *) symName, name );
+ c2pstr( (char *) symName );
+#endif
+ if( FindSymbol( ((CFragConnectionID)dllHandle), symName, &symAddress, &symClass ) == noErr )
+ symbol = (void *)symAddress;
+
+#elif defined(__WXPM__) || defined(__EMX__)
+ wxDllGetSymbol(dllHandle, symbol);
+