+2024-07-01 Bruno Haible <bruno@clisp.org>
+
+ Avoid some possibly wrong configure test results.
+ Reported by Arsen Arsenović <arsen@gentoo.org> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00000.html>.
+ * m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): Include necessary header file
+ for _exit().
+ (gl_SNPRINTF_DIRECTIVE_N): Likewise.
+ * m4/memmem.m4 (gl_FUNC_MEMMEM): Update comment.
+ * m4/sleep.m4 (gl_FUNC_SLEEP): Likewise.
+ * m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Likewise.
+ * m4/strstr.m4 (gl_FUNC_STRSTR): Likewise.
+ * m4/wcsstr.m4 (gl_FUNC_WCSSTR): Likewise.
+
2024-06-30 Collin Funk <collin.funk1@gmail.com>
doc: Remove references to POSIX 202x.
# memmem.m4
-# serial 29
+# serial 30
dnl Copyright (C) 2002-2004, 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,
char *haystack = (char *) malloc (2 * m + 1);
char *needle = (char *) malloc (m + 1);
/* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also lack memmem. */
+ since all such platforms (mingw, MSVC) also lack memmem. */
signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */
# printf.m4
-# serial 94
+# serial 95
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,
[AC_LANG_SOURCE([[
#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <stdlib.h>
+#else
+# include <unistd.h>
+#endif
#ifdef _MSC_VER
#include <crtdbg.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <stdlib.h>
+#else
+# include <unistd.h>
+#endif
#if HAVE_SNPRINTF
# define my_snprintf snprintf
#else
# sleep.m4
-# serial 13
+# serial 14
dnl Copyright (C) 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,
}
]], [[
/* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also lack sleep. */
+ since all such platforms (mingw, MSVC) also lack sleep. */
unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */
unsigned int remaining;
signal (SIGALRM, handle_alarm);
# strcasestr.m4
-# serial 28
+# serial 29
dnl Copyright (C) 2005, 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,
char *haystack = (char *) malloc (2 * m + 2);
char *needle = (char *) malloc (m + 2);
/* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also lack strcasestr. */
+ since all such platforms (mingw, MSVC) also lack strcasestr. */
signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */
# strstr.m4
-# serial 24
+# serial 25
dnl Copyright (C) 2008-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,
char *haystack = (char *) malloc (2 * m + 2);
char *needle = (char *) malloc (m + 2);
/* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also have quadratic strstr. */
+ since all such platforms (mingw, MSVC) also have quadratic strstr. */
signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */
# wcsstr.m4
-# serial 3
+# serial 4
dnl Copyright (C) 2011-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,
wchar_t *haystack = (wchar_t *) malloc ((2 * m + 2) * sizeof (wchar_t));
wchar_t *needle = (wchar_t *) malloc ((m + 2) * sizeof (wchar_t));
/* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also have quadratic strstr. */
+ since all such platforms (mingw, MSVC) also have quadratic wcsstr. */
signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */