Remove obsolete Darwin-specific code in dynlib.*/dlunix.cpp
We don't have our own dlxxx() implementations under Darwin since 76c5594
(Remove our own dlxxx() functions emulation for OS X <= 10.3.,
2013-10-17).
wxHAVE_DYNLIB_ERROR is reduced to being the same HAVE_DLERROR, so use
the latter one instead.
Closes https://github.com/wxWidgets/wxWidgets/pull/1826
This commit is contained in:
committed by
Vadim Zeitlin
parent
67c1c412c6
commit
42af101836
@@ -18,11 +18,6 @@
|
|||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
#include "wx/dynarray.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;
|
class WXDLLIMPEXP_FWD_BASE wxDynamicLibraryDetailsCreator;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -31,9 +26,6 @@ class WXDLLIMPEXP_FWD_BASE wxDynamicLibraryDetailsCreator;
|
|||||||
|
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
typedef WXHMODULE wxDllType;
|
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)
|
#elif defined(HAVE_DLOPEN)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
typedef void *wxDllType;
|
typedef void *wxDllType;
|
||||||
@@ -365,10 +357,10 @@ protected:
|
|||||||
// common part of GetSymbol() and HasSymbol()
|
// common part of GetSymbol() and HasSymbol()
|
||||||
void* DoGetSymbol(const wxString& name, bool* success = NULL) const;
|
void* DoGetSymbol(const wxString& name, bool* success = NULL) const;
|
||||||
|
|
||||||
#ifdef wxHAVE_DYNLIB_ERROR
|
#ifdef HAVE_DLERROR
|
||||||
// log the error after a dlxxx() function failure
|
// log the error after a dlxxx() function failure
|
||||||
static void Error();
|
static void Error();
|
||||||
#endif // wxHAVE_DYNLIB_ERROR
|
#endif // HAVE_DLERROR
|
||||||
|
|
||||||
|
|
||||||
// the handle to DLL or NULL
|
// the handle to DLL or NULL
|
||||||
|
@@ -86,7 +86,7 @@ bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags)
|
|||||||
|
|
||||||
if ( m_handle == 0 && !(flags & wxDL_QUIET) )
|
if ( m_handle == 0 && !(flags & wxDL_QUIET) )
|
||||||
{
|
{
|
||||||
#ifdef wxHAVE_DYNLIB_ERROR
|
#ifdef HAVE_DLERROR
|
||||||
Error();
|
Error();
|
||||||
#else
|
#else
|
||||||
wxLogSysError(_("Failed to load shared library '%s'"), libname.c_str());
|
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);
|
void *symbol = DoGetSymbol(name, success);
|
||||||
if ( !symbol )
|
if ( !symbol )
|
||||||
{
|
{
|
||||||
#ifdef wxHAVE_DYNLIB_ERROR
|
#ifdef HAVE_DLERROR
|
||||||
Error();
|
Error();
|
||||||
#else
|
#else
|
||||||
wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"),
|
wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"),
|
||||||
|
@@ -36,10 +36,6 @@
|
|||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __DARWIN__
|
|
||||||
#include <AvailabilityMacros.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// if some flags are not supported, just ignore them
|
// if some flags are not supported, just ignore them
|
||||||
#ifndef RTLD_LAZY
|
#ifndef RTLD_LAZY
|
||||||
#define RTLD_LAZY 0
|
#define RTLD_LAZY 0
|
||||||
@@ -54,7 +50,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_DLOPEN) || defined(__DARWIN__)
|
#if defined(HAVE_DLOPEN)
|
||||||
#define USE_POSIX_DL_FUNCS
|
#define USE_POSIX_DL_FUNCS
|
||||||
#elif !defined(HAVE_SHL_LOAD)
|
#elif !defined(HAVE_SHL_LOAD)
|
||||||
#error "Don't know how to load dynamic libraries on this platform!"
|
#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 */
|
/* static */
|
||||||
void wxDynamicLibrary::Unload(wxDllType handle)
|
void wxDynamicLibrary::Unload(wxDllType handle)
|
||||||
{
|
{
|
||||||
#ifdef wxHAVE_DYNLIB_ERROR
|
#ifdef HAVE_DLERROR
|
||||||
int rc =
|
int rc =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -122,7 +118,7 @@ void wxDynamicLibrary::Unload(wxDllType handle)
|
|||||||
shl_unload(handle);
|
shl_unload(handle);
|
||||||
#endif // USE_POSIX_DL_FUNCS/!USE_POSIX_DL_FUNCS
|
#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 )
|
if ( rc != 0 )
|
||||||
Error();
|
Error();
|
||||||
#endif
|
#endif
|
||||||
@@ -149,7 +145,7 @@ void *wxDynamicLibrary::RawGetSymbol(wxDllType handle, const wxString& name)
|
|||||||
// error handling
|
// error handling
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef wxHAVE_DYNLIB_ERROR
|
#ifdef HAVE_DLERROR
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
void wxDynamicLibrary::Error()
|
void wxDynamicLibrary::Error()
|
||||||
@@ -162,7 +158,7 @@ void wxDynamicLibrary::Error()
|
|||||||
wxLogError(wxT("%s"), err);
|
wxLogError(wxT("%s"), err);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxHAVE_DYNLIB_ERROR
|
#endif // HAVE_DLERROR
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// listing loaded modules
|
// listing loaded modules
|
||||||
|
Reference in New Issue
Block a user