diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index 4ea6b8a60c..6c791cfaba 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -18,11 +18,6 @@ #include "wx/string.h" #include "wx/dynarray.h" -// note that we have our own dlerror() implementation under Darwin -#if defined(HAVE_DLERROR) || defined(__DARWIN__) - #define wxHAVE_DYNLIB_ERROR -#endif - class WXDLLIMPEXP_FWD_BASE wxDynamicLibraryDetailsCreator; // ---------------------------------------------------------------------------- @@ -31,9 +26,6 @@ class WXDLLIMPEXP_FWD_BASE wxDynamicLibraryDetailsCreator; #if defined(__WINDOWS__) typedef WXHMODULE wxDllType; -#elif defined(__DARWIN__) - // Don't include dlfcn.h on Darwin, we may be using our own replacements. - typedef void *wxDllType; #elif defined(HAVE_DLOPEN) #include typedef void *wxDllType; @@ -365,10 +357,10 @@ protected: // common part of GetSymbol() and HasSymbol() void* DoGetSymbol(const wxString& name, bool* success = NULL) const; -#ifdef wxHAVE_DYNLIB_ERROR +#ifdef HAVE_DLERROR // log the error after a dlxxx() function failure static void Error(); -#endif // wxHAVE_DYNLIB_ERROR +#endif // HAVE_DLERROR // the handle to DLL or NULL diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index b174aa9560..13b0f4544e 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -86,7 +86,7 @@ bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags) if ( m_handle == 0 && !(flags & wxDL_QUIET) ) { -#ifdef wxHAVE_DYNLIB_ERROR +#ifdef HAVE_DLERROR Error(); #else wxLogSysError(_("Failed to load shared library '%s'"), libname.c_str()); @@ -114,7 +114,7 @@ void *wxDynamicLibrary::GetSymbol(const wxString& name, bool *success) const void *symbol = DoGetSymbol(name, success); if ( !symbol ) { -#ifdef wxHAVE_DYNLIB_ERROR +#ifdef HAVE_DLERROR Error(); #else wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"), diff --git a/src/unix/dlunix.cpp b/src/unix/dlunix.cpp index ab057419e5..325d029c02 100644 --- a/src/unix/dlunix.cpp +++ b/src/unix/dlunix.cpp @@ -36,10 +36,6 @@ #include #endif -#ifdef __DARWIN__ - #include -#endif - // if some flags are not supported, just ignore them #ifndef RTLD_LAZY #define RTLD_LAZY 0 @@ -54,7 +50,7 @@ #endif -#if defined(HAVE_DLOPEN) || defined(__DARWIN__) +#if defined(HAVE_DLOPEN) #define USE_POSIX_DL_FUNCS #elif !defined(HAVE_SHL_LOAD) #error "Don't know how to load dynamic libraries on this platform!" @@ -112,7 +108,7 @@ wxDllType wxDynamicLibrary::RawLoad(const wxString& libname, int flags) /* static */ void wxDynamicLibrary::Unload(wxDllType handle) { -#ifdef wxHAVE_DYNLIB_ERROR +#ifdef HAVE_DLERROR int rc = #endif @@ -122,7 +118,7 @@ void wxDynamicLibrary::Unload(wxDllType handle) shl_unload(handle); #endif // USE_POSIX_DL_FUNCS/!USE_POSIX_DL_FUNCS -#if defined(USE_POSIX_DL_FUNCS) && defined(wxHAVE_DYNLIB_ERROR) +#if defined(USE_POSIX_DL_FUNCS) && defined(HAVE_DLERROR) if ( rc != 0 ) Error(); #endif @@ -149,7 +145,7 @@ void *wxDynamicLibrary::RawGetSymbol(wxDllType handle, const wxString& name) // error handling // ---------------------------------------------------------------------------- -#ifdef wxHAVE_DYNLIB_ERROR +#ifdef HAVE_DLERROR /* static */ void wxDynamicLibrary::Error() @@ -162,7 +158,7 @@ void wxDynamicLibrary::Error() wxLogError(wxT("%s"), err); } -#endif // wxHAVE_DYNLIB_ERROR +#endif // HAVE_DLERROR // ---------------------------------------------------------------------------- // listing loaded modules