]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dynlib.cpp
Pass correct length to XTextExtents
[wxWidgets.git] / src / common / dynlib.cpp
index 025667914bd5419215abd87e82b3eac3d5698c07..6dd93ebcdc9c22adb0ce6924e0e5b983fe2e5592 100644 (file)
@@ -27,7 +27,7 @@
   #pragma hdrstop
 #endif
 
-#if wxUSE_DYNLIB_CLASS
+#if wxUSE_DYNLIB_CLASS && !wxUSE_DYNAMIC_LOADER
 
 #if defined(__WINDOWS__)
     #include "wx/msw/private.h"
 #include "wx/intl.h"
 #include "wx/log.h"
 
+#if defined(__WXMAC__)
+    #include "wx/mac/private.h"
+#endif
+
 // ----------------------------------------------------------------------------
 // conditional compilation
 // ----------------------------------------------------------------------------
@@ -105,7 +109,7 @@ const char *dlerror(void);
 #   define wxDllGetSymbol(handle, name)    ::GetProcAddress(handle, name)
 #   define wxDllClose                      ::FreeLibrary
 #elif defined(__WXMAC__)
-#   define wxDllClose(handle)               CloseConnection(&handle)
+#   define wxDllClose(handle)               CloseConnection(&((CFragConnectionID)handle))
 #else
 #   error "Don't know how to load shared libraries on this platform."
 #endif // OS
@@ -207,6 +211,8 @@ const wxString wxDllLoader::ms_dllext( _T(".sl") );
 #else
 const wxString wxDllLoader::ms_dllext( _T(".so") );
 #endif
+#elif defined(__WXMAC__)
+const wxString wxDllLoader::ms_dllext( _T("") );
 #endif
 
 /* static */
@@ -242,7 +248,7 @@ wxDllType wxDllLoader::LoadLibrary(const wxString & libname, bool *success)
                          kCFragGoesToEOF,
                          "\p",
                          kPrivateCFragCopy,
-                         &handle,
+                         &((CFragConnectionID)handle),
                          &myMainAddr,
                          myErrName ) != noErr )
     {
@@ -268,7 +274,7 @@ wxDllType wxDllLoader::LoadLibrary(const wxString & libname, bool *success)
         wxString msg(_("Failed to load shared library '%s'"));
 
 #ifdef HAVE_DLERROR
-        wxChar  *err = dlerror();
+        const wxChar *err = dlerror();
         if( err )
         {
             failed = TRUE;
@@ -310,7 +316,7 @@ void *wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *su
     strcpy( (char *) symName, name );
     c2pstr( (char *) symName );
 #endif
-    if( FindSymbol( dllHandle, symName, &symAddress, &symClass ) == noErr )
+    if( FindSymbol( ((CFragConnectionID)dllHandle), symName, &symAddress, &symClass ) == noErr )
         symbol = (void *)symAddress;
 
 #elif defined(__WXPM__) || defined(__EMX__)
@@ -327,7 +333,7 @@ void *wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *su
         wxString msg(_("wxDllLoader failed to GetSymbol '%s'"));
 
 #ifdef HAVE_DLERROR
-        wxChar  *err = dlerror();
+        const wxChar *err = dlerror();
         if( err )
         {
             failed = TRUE;