#include "wx/wxprec.h"
-#ifdef __BORLANDC__
-# pragma hdrstop
-#endif //__BORLANDC__
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
#if wxUSE_DYNLIB_CLASS
// ----------------------------------------------------------------------------
#if defined(HAVE_DLOPEN)
-# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_LAZY)
+# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_NOW/*RTLD_LAZY*/)
# define wxDllGetSymbol(handle, name) dlsym(handle, name.mb_str())
# define wxDllClose dlclose
#elif defined(HAVE_SHL_LOAD)
// wxDllLoader
// ---------------------------------------------------------------------------
+/* static */
+wxDllType
+wxDllLoader::GetProgramHandle(void)
+{
+#ifdef __UNIX__
+ return dlopen(NULL, RTLD_NOW/*RTLD_LAZY*/);
+#else
+ wxFAIL_MSG(_("This method is not implemented under Windows"));
+
+ return 0;
+#endif
+}
+
+
/* static */
wxDllType
wxDllLoader::LoadLibrary(const wxString & lib_name, bool *success)
return handle;
}
+
+/* static */
+void
+wxDllLoader::UnloadLibrary(wxDllType handle)
+{
+ wxDllClose(handle);
+}
+
/* static */
void *
wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name)
#endif
bool success = FALSE;
- wxDllType handle = wxDllLoader::LoadDll(lib_name, &success);
+ wxDllType handle = wxDllLoader::LoadLibrary(lib_name, &success);
if(success)
{
lib = new wxLibrary(handle);