Add a test exercising the IPC-over-sockets implementation from a single
thread and from multiple threads concurrently (Execute, Request, Poke,
Advise, combined Advise+Request, and concurrent main-thread and
worker-thread Request()s).
Each test starts its own server by re-executing the test program with
WX_IPC_TEST_SERVER set and shuts it down again in the fixture teardown, so
no server process outlives a test (or disturbs the unrelated GUI tests in
test_gui). The client runs in the main Catch2 process and queries the server
for state to verify it (Catch2 macros cannot run in the server process). The
wait loops are wall-clock bounded so they behave under a GUI event loop, and
a per-fixture watchdog aborts with a diagnostic if a test ever hangs rather
than letting CI time out.
The test runs in both the console "test" and the GUI "test_gui" programs. It
is excluded from one configuration: wxQt, whose event loop does not reliably
process a cross-thread CallAfter() (a wxQt bug fixed separately).
LoadCachedBook reads each index entry's parent back-reference straight
from the .cached file and uses it as an index with no check, so a
crafted cached file (which can sit inside a .htb help archive opened
through AddBook) may result in creating a pointer to data outside the
m_index array; that pointer is later dereferenced when the index is
sorted at the end of AddBookParam.
The change rejects the file when parentShift is negative or larger than
the number of index entries loaded so far, matching the existing version
and flags checks just above.
Also add a small test under tests/html that feeds such a cached stream
and confirms it is now refused rather than reading out of bounds.
Closes#26577.
Link with "log" library and account for Android having gethostbyname_r()
but not getservbyname_r().
Also remove unnecessary include/wx/android/setup.h and config_android.h
files which seem to have been never used since they were added back in
1b4bff8262 (Add minimal support for building non-GUI parts of wxWidgets
for Android., 2012-02-26).
Closes#26539.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
It has not been possible to build with this option disabled for 4 years.
It appears there has been little effort to support this option since
then. For 8 years, there has been a duplicate definition of
wxUxThemeIsActive(), causing a linker warning.
Closes#26509.
So IDEs like Visual Studio show the correct character set.
Add an option to override the character set and use it in the win32 API tests.
See #26458.
Closes#26462.
Disabling it doesn't save much on code size and the build without it is
currently broken anyhow, so just remove the possibility to turn it off.
Closes#26388.
Closes#26402.
It is useless in this case as make/Ninja generators only compile a
single file at once anyhow and can also be harmful when using clang-cl
compiler which gives warnings about unsupported option.
See #26392.
Can be used by console applications, it links with wx::base with wxUSE_GUI=0.
Update wx_copy_target in wxWidgetsConfig.cmake to handle INTERFACE libraries correctly.
See #26285
Try to install using 'ln -s --relative' first, before falling back to 'ln -s' and 'cmake -E create_symlink'.
If all fail, use 'cmake -E copy'.
Also add an option to disable using symlinks and always copy.
Correctly use and (not) escape DESTDIR and CMAKE_INSTALL_PREFIX in install and uninstall variables.
Fixes#26247
When installing static libraries, the built-in libraries also need import mappings for MinSizeRel and RelWithDebInfo configurations.
Otherwise they will default to using Debug libraries.
It's not clear if __timezone ever exists, but at the very least don't
test for it first as this fails with MSVC when testing for _timezone
succeeds.
This should have been done in 12a3a16e7b (Prefer using "timezone" to
"__timezone" on POSIX systems, 2026-04-07).
See #25310.
Using check_function_exists() seems to be prone to false positives, e.g.
it detects pthread_mutex_timedlock() as being available under iOS when
it's not actually available there and the build fails later.
Enabling wxUSE_DETECT_SM option broke the build for systems where SM
library is not available as there were no actual checks for it.
Add the check now.
These functions are always available, as proven by #error directives in
the code never triggering for all the years they were there, so stop
checking for them and just assume they are available.
Also simplify the check for gethostbyname_r() in CMake and just test
directly if we can use the function with the given prototype, reducing
the number of checks to one in the most common case when before we made
3 of them (one extra due to checking if the function existed first and
another one due to a logical but wrong idea that we need to check for 5
before 6).
Finally, also define HAVE_FUNC_GETSERVBYNAME_R_{6,5} in CMake,
previously it never defined them at all and so reentrant functions were
never used.
The existing test was reversed (which indicates that we probably don't
need to test for gethostname() at all and could just assume that uname()
is always available), we only need gethostname() as fallback in case
uname() is not found.
This seems to have been used by old versions of IRIX and shouldn't be in
use anywhere any more, so simplify the code by not taking this prototype
into account any more.
The check for this pre-C99 Solaris header was added back in a49ffb32e2
(include widec.h if it's available, it contains declarations of
[f]putws() under Solaris, 2006-11-09) and shouldn't be needed any more.
CMake never checked for it, so remove the check from configure too and
then remove the now never defined HAVE_WIDEC_H.
We don't support ancient MSVC version which didn't treat wchar_t as a
distinct type, so don't bother catering for such compilers and simplify
the code by removing the checks for wxWCHAR_T_IS_REAL_TYPE.
Also remove the checks for this from configure and CMake.