From 237c5c02427fe15b0f7c5ed87a4b582d5b069c8e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 17 Jan 2001 16:45:04 +0000 Subject: [PATCH] added RTLD_GLOBAL to dlopen flags (bug 128705) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dynlib.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 3aa8cc8758..ca16df0daa 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -50,12 +50,16 @@ # define wxDllGetSymbol(handle, modaddr) DosQueryProcAddr(handle, 1L, NULL, (PFN*)modaddr) # define wxDllClose(handle) DosFreeModule(handle) #elif defined(HAVE_DLOPEN) -# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_NOW/*RTLD_LAZY*/) + // note about dlopen() flags: we use RTLD_NOW to have more Windows-like + // behaviour (Win won't let you load a library with missing symbols) and + // RTLD_GLOBAL because it is needed sometimes and probably doesn't hurt + // otherwise +# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_LAZY | RTLD_GLOBAL) # define wxDllGetSymbol(handle, name) dlsym(handle, name) # define wxDllClose dlclose #elif defined(HAVE_SHL_LOAD) # define wxDllOpen(lib) shl_load(lib.fn_str(), BIND_DEFERRED, 0) -# define wxDllClose shl_unload +# define wxDllClose shl_unload static inline void *wxDllGetSymbol(shl_t handle, const wxString& name) { -- 2.45.2