+2024-04-30 Bruno Haible <bruno@clisp.org>
+
+ *printf: Avoid a dialog during 'configure' with MSVC in debug mode.
+ Suggested by Paul Harris <harris.pc@gmail.com> in
+ <https://lists.gnu.org/archive/html/bug-gettext/2024-04/msg00005.html>.
+ * m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): In the test program, include
+ <crtdbg.h> and disable the MSVC reporting for assertion failures.
+
2024-04-30 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Remove remaining unused instance variables.
# printf.m4
-# serial 91
+# serial 92
dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
#include <stdlib.h>
#include <string.h>
#ifdef _MSC_VER
+#include <crtdbg.h>
#include <inttypes.h>
/* See page about "Parameter Validation" on msdn.microsoft.com.
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
int count = -1;
#ifdef _MSC_VER
_set_invalid_parameter_handler (invalid_parameter_handler);
+ /* Also avoid an Abort/Retry/Ignore dialog in debug builds.
+ <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode> */
+ _CrtSetReportMode (_CRT_ASSERT, 0);
#endif
signal (SIGABRT, abort_handler);
/* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)