]> Savannah Git Hosting - gnulib.git/commitdiff
Avoid some possibly wrong configure test results.
authorBruno Haible <bruno@clisp.org>
Mon, 1 Jul 2024 15:33:17 +0000 (17:33 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jul 2024 01:09:11 +0000 (03:09 +0200)
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.

ChangeLog
m4/memmem.m4
m4/printf.m4
m4/sleep.m4
m4/strcasestr.m4
m4/strstr.m4
m4/wcsstr.m4

index dcfa4b80c2afdc9705fe5a05318151ed083253f2..16ca14ad41aed581b54eed255d8ede21c5defd16 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+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.
index a9bc277813b08f130572616164dcb5e55acc0aa6..e6b1d91cbb196db134892d359b559311c5b7d4c3 100644 (file)
@@ -1,5 +1,5 @@
 # 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,
@@ -102,7 +102,7 @@ static void quit (int sig) { _exit (sig + 128); }
     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.  */
index 1363fe19e4c1a8f8785db8507844997bd889ab0a..a6daa1a62cc0b95f09deec79a732d257eb8df926 100644 (file)
@@ -1,5 +1,5 @@
 # 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,
@@ -897,8 +897,12 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
         [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>
@@ -1717,6 +1721,11 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
 #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
index 06f58b28602804df198ee0133c581a8ef962b2ae..ec8764bd2a0530ea95d0f45b572bb37267cc515b 100644 (file)
@@ -1,5 +1,5 @@
 # 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,
@@ -33,7 +33,7 @@ handle_alarm (int sig)
 }
 ]], [[
     /* 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);
index d254871677a4e91e89c533ba0815b1d881a92a7d..811e680ff5bd2e85cb42ddd35004b14314a50b1d 100644 (file)
@@ -1,5 +1,5 @@
 # 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,
@@ -98,7 +98,7 @@ static void quit (int sig) { _exit (sig + 128); }
     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.  */
index 957ed2e3078348ea8107de4903c3cb82612c0e0c..d19559aa25a2fe4e06641e10f9ee26130a2b2b25 100644 (file)
@@ -1,5 +1,5 @@
 # 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,
@@ -95,7 +95,7 @@ static void quit (int sig) { _exit (sig + 128); }
     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.  */
index eb43b9f35466a5b5238d31024432e94406ba7492..20dd8406cc44876c5f1345579665e3689fcac24a 100644 (file)
@@ -1,5 +1,5 @@
 # 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,
@@ -34,7 +34,7 @@ static void quit (int sig) { _exit (sig + 128); }
     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.  */