Add wxDynamicLibrary::GetModuleFromAddress().

Use dladdr() under Unix, if available, to provide the same functionality as we
get from GetModuleHandleEx() under MSW and export it in a new public function.

Closes #15248.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-03-11 16:04:06 +00:00
parent acd8a61bd8
commit f51dc81c85
9 changed files with 186 additions and 26 deletions

57
configure vendored
View File

@@ -33348,6 +33348,63 @@ fi
fi
done
for ac_func in dladdr
do :
ac_fn_c_check_func "$LINENO" "dladdr" "ac_cv_func_dladdr"
if test "x$ac_cv_func_dladdr" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_DLADDR 1
_ACEOF
$as_echo "#define HAVE_DLADDR 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in -ldl" >&5
$as_echo_n "checking for dladdr in -ldl... " >&6; }
if ${ac_cv_lib_dl_dladdr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dladdr ();
int
main ()
{
return dladdr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dladdr=yes
else
ac_cv_lib_dl_dladdr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dladdr" >&5
$as_echo "$ac_cv_lib_dl_dladdr" >&6; }
if test "x$ac_cv_lib_dl_dladdr" = xyes; then :
$as_echo "#define HAVE_DLADDR 1" >>confdefs.h
fi
fi
done