Use dl_iterate_phdr() in wxDynamicLibrary::ListLoaded()

This has the advantage of returning libraries in their load order, which
is more useful than the unspecified order that was used before.

It also means that this function now has a chance of working under other
systems such as FreeBSD, which also provides dl_iterate_phdr().
This commit is contained in:
Vadim Zeitlin 2023-09-06 00:38:15 +02:00
parent d22275ce0a
commit aec49d9c9d
6 changed files with 75 additions and 76 deletions

View file

@ -565,6 +565,7 @@ check_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
cmake_pop_check_state()
if(HAVE_DLOPEN)
check_symbol_exists(dladdr dlfcn.h HAVE_DLADDR)
check_symbol_exists(dl_iterate_phdr link.h HAVE_DL_ITERATE_PHDR)
endif()
if(APPLE)