]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dynlib.cpp
* wxDataStreams use wxUint now.
[wxWidgets.git] / src / common / dynlib.cpp
index 1e0fc6bdf449d42be7b2db2e6e7844aae99936ca..0a161789d88aa40b6cd5936d4357f604a585c641 100644 (file)
@@ -23,9 +23,9 @@
 
 #include  "wx/wxprec.h"
 
-#ifdef    __BORLANDC__
-#   pragma hdrstop
-#endif  //__BORLANDC__
+#ifdef __BORLANDC__
+  #pragma hdrstop
+#endif
 
 #if wxUSE_DYNLIB_CLASS
 
@@ -40,7 +40,7 @@
 // ----------------------------------------------------------------------------
 
 #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)
@@ -174,7 +174,20 @@ void *wxLibrary::GetSymbol(const wxString& symbname)
 
 /* static */
 wxDllType
-wxDllLoader::LoadLibrary(const wxString & libname, bool *success)
+wxDllLoader::GetProgramHandle(void)
+{
+#ifdef __WXGTK__
+   return dlopen(NULL, RTLD_NOW/*RTLD_LAZY*/);
+#else
+#pragma warning "Not implemented, please fix!"
+   return 0;
+#endif   
+}
+
+
+/* static */
+wxDllType
+wxDllLoader::LoadLibrary(const wxString & lib_name, bool *success)
 {
    wxASSERT(success);
    
@@ -231,7 +244,7 @@ wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name)
     if ( !symbol )
     {
        wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"),
-                     symbname.c_str());
+                     name.c_str());
     }
     return symbol;
 }
@@ -300,8 +313,8 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name)
 #endif // __UNIX__
 #endif
 
-    bool success;
-    handle = wxDllLoader::LoadDll(lib_name, &success);
+    bool success = FALSE;
+    wxDllType handle = wxDllLoader::LoadLibrary(lib_name, &success);
     if(success)
     {
        lib = new wxLibrary(handle);