summaryrefslogtreecommitdiffstats
path: root/m4/strtol.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/strtol.m4')
-rw-r--r--m4/strtol.m420
1 files changed, 13 insertions, 7 deletions
diff --git a/m4/strtol.m4 b/m4/strtol.m4
index 5cdd86a..d5c6079 100644
--- a/m4/strtol.m4
+++ b/m4/strtol.m4
@@ -1,5 +1,5 @@
-# strtol.m4 serial 8
-dnl Copyright (C) 2002-2003, 2006, 2009-2023 Free Software Foundation, Inc.
+# strtol.m4 serial 10
+dnl Copyright (C) 2002-2003, 2006, 2009-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,
dnl with or without modifications, as long as this notice is preserved.
@@ -19,10 +19,16 @@ AC_DEFUN([gl_FUNC_STRTOL],
char *term;
/* This test fails on Minix and native Windows. */
{
- const char input[] = "0x";
- (void) strtol (input, &term, 16);
- if (term != input + 1)
- result |= 1;
+ static char const input[2][3] = {"0x", "0b"};
+ static int const base[] = {0, 2, 10};
+ int i, j;
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 3; j++)
+ {
+ (void) strtol (input[i], &term, base[j]);
+ if (term != input[i] + 1)
+ result |= 1;
+ }
}
/* This test fails on pre-C23 platforms. */
{
@@ -38,7 +44,7 @@ AC_DEFUN([gl_FUNC_STRTOL],
[gl_cv_func_strtol_works=no],
[case "$host_os" in
# Guess no on native Windows.
- mingw*) gl_cv_func_strtol_works="guessing no" ;;
+ mingw* | windows*) gl_cv_func_strtol_works="guessing no" ;;
# Guess no on glibc systems.
*-gnu* | gnu*) gl_cv_func_strtol_works="guessing no" ;;
# Guess no on musl systems.