From 7eb79e69595a92398bf1d63c5c0799de6647130c Mon Sep 17 00:00:00 2001 From: Christian Andersen Date: Sun, 4 Feb 2024 17:04:09 +0100 Subject: [PATCH] Windows: Fix assertion pop-up up when using Debug compiled libressl. When running the signertest, or the test project in https://github.com/libressl/portable/issues/266 an assertion window pops up. This was fixed in afcd4be8a72a for a release compiled library. To prevent the issue in debug mode, it looks like it is necessary to also disable the assertion window popup. With this all tests pass when compiling and running them with a Debug, Release or RelWithDebInfo CMake build on windows (for me). --- crypto/compat/posix_win.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c index c7cf6af3d8..3e78a07c64 100644 --- a/crypto/compat/posix_win.c +++ b/crypto/compat/posix_win.c @@ -164,8 +164,10 @@ static void noop_handler(const wchar_t *expression, const wchar_t *function, } #define BEGIN_SUPPRESS_IPH \ + int old_report_mode = _CrtSetReportMode(_CRT_ASSERT, 0); \ _invalid_parameter_handler old_handler = _set_thread_local_invalid_parameter_handler(noop_handler) #define END_SUPPRESS_IPH \ + _CrtSetReportMode(_CRT_ASSERT, old_report_mode); \ _set_thread_local_invalid_parameter_handler(old_handler) #else