diff options
author | Christian Andersen <csandersen3@gmail.com> | 2024-04-01 22:00:33 +0200 |
---|---|---|
committer | Christian Andersen <csandersen3@gmail.com> | 2024-04-09 21:15:34 +0200 |
commit | 8ce97109256eb6df13c091510485a83821424971 (patch) | |
tree | 58fe85a2526016c382569cef540907042bc334b2 | |
parent | 0eea45f4001dc75a7123d62a788fce7fd485bd8b (diff) | |
download | portable-8ce97109256eb6df13c091510485a83821424971.tar.gz portable-8ce97109256eb6df13c091510485a83821424971.tar.bz2 portable-8ce97109256eb6df13c091510485a83821424971.zip |
[Windows] Mark old_report_mode as unused
When compiling in release mode the _CrtSetReportMode macro
gets replaced by void(0). This makes old_report_mode unused.
Silence a warning about it.
-rw-r--r-- | crypto/compat/posix_win.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c index 3e78a07..bb3e653 100644 --- a/crypto/compat/posix_win.c +++ b/crypto/compat/posix_win.c | |||
@@ -164,9 +164,10 @@ static void noop_handler(const wchar_t *expression, const wchar_t *function, | |||
164 | } | 164 | } |
165 | 165 | ||
166 | #define BEGIN_SUPPRESS_IPH \ | 166 | #define BEGIN_SUPPRESS_IPH \ |
167 | int old_report_mode = _CrtSetReportMode(_CRT_ASSERT, 0); \ | 167 | const int old_report_mode = _CrtSetReportMode(_CRT_ASSERT, 0); \ |
168 | _invalid_parameter_handler old_handler = _set_thread_local_invalid_parameter_handler(noop_handler) | 168 | const _invalid_parameter_handler old_handler = _set_thread_local_invalid_parameter_handler(noop_handler) |
169 | #define END_SUPPRESS_IPH \ | 169 | #define END_SUPPRESS_IPH \ |
170 | (void)old_report_mode; /* Silence warning in release mode when _CrtSetReportMode compiles to void. */ \ | ||
170 | _CrtSetReportMode(_CRT_ASSERT, old_report_mode); \ | 171 | _CrtSetReportMode(_CRT_ASSERT, old_report_mode); \ |
171 | _set_thread_local_invalid_parameter_handler(old_handler) | 172 | _set_thread_local_invalid_parameter_handler(old_handler) |
172 | 173 | ||