X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a8522481f71a43df96d6322890e9f539c7737993..f352dd54f0c495798d73e54ec96be8d628a2c787:/src/common/dynlib.cpp diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index fcefd941e3..558b579e0c 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -146,7 +146,7 @@ wxLibrary::wxLibrary(wxDllType handle) m_handle = handle; // Some system may use a local heap for library. - get_first = (t_get_first)GetSymbol("wxGetClassFirst"); + get_first = (t_get_first)GetSymbol(_T("wxGetClassFirst")); // It is a wxWindows DLL. if (get_first) PrepareClasses(get_first()); @@ -322,22 +322,22 @@ void *wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *su #elif defined(__WXPM__) || defined(__EMX__) wxDllGetSymbol(dllHandle, symbol); -#else +#else // Windows or Unix + // mb_str() is necessary in Unicode build - symbol = wxDllGetSymbol(dllHandle, name.mb_str()); + // + // "void *" cast is needed by gcc 3.1 + w32api 1.4, don't ask me why + symbol = (void *)wxDllGetSymbol(dllHandle, name.mb_str()); -#endif +#endif // OS if ( !symbol ) { - wxString msg(_("wxDllLoader failed to GetSymbol '%s'")); - #ifdef HAVE_DLERROR const wxChar *err = dlerror(); if( err ) { - failed = TRUE; - wxLogError( msg, err ); + wxLogError(wxT("%s"), err); } #else failed = TRUE; @@ -416,13 +416,16 @@ wxObject *wxLibraries::CreateObject(const wxString& path) return NULL; } -#ifdef __DARWIN__ +#endif // wxUSE_DYNLIB_CLASS && !wxUSE_DYNAMIC_LOADER + +#if defined(__DARWIN__) && (wxUSE_DYNLIB_CLASS || wxUSE_DYNAMIC_LOADER) // --------------------------------------------------------------------------- // For Darwin/Mac OS X // supply the sun style dlopen functions in terms of Darwin NS* // --------------------------------------------------------------------------- -#import +#include +#include static char dl_last_error[1024]; @@ -454,7 +457,7 @@ const char *dlerror() return dl_last_error; } -void *dlopen(const char *path, int mode /* mode is ignored */) +void *dlopen(const char *path, int WXUNUSED(mode) /* mode is ignored */) { int dyld_result; NSObjectFileImage ofile; @@ -481,7 +484,7 @@ int dlclose(void *handle) return 0; } -void *dlsym(void *handle, const char *symbol) +void *dlsym(void *WXUNUSED(handle), const char *symbol) { void *addr; @@ -494,6 +497,4 @@ void *dlsym(void *handle, const char *symbol) return addr; } -#endif // __DARWIN__ - -#endif // wxUSE_DYNLIB_CLASS +#endif // defined(__DARWIN__) && (wxUSE_DYNLIB_CLASS || wxUSE_DYNAMIC_LOADER)