summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2025-01-15 19:31:07 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2025-01-15 19:31:39 -0800
commit74dc2bd28007e68532d9813a57d3ec7da0c390e3 (patch)
tree1dbf3c1106bfe8b240165710e73c18f3f1940f89 /m4
parent4f946a652278cc72a777fe56999bc4525f53e03a (diff)
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'm4')
-rw-r--r--m4/assert_h.m48
-rw-r--r--m4/string_h.m46
-rw-r--r--m4/sys_socket_h.m445
3 files changed, 38 insertions, 21 deletions
diff --git a/m4/assert_h.m4 b/m4/assert_h.m4
index 91f446e7f6d..e77524caff9 100644
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -1,5 +1,5 @@
# assert_h.m4
-# serial 4
+# serial 5
dnl Copyright (C) 2011-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -64,11 +64,13 @@ AC_DEFUN([gl_ASSERT_H],
[#if (!(defined __clang__ \
? (defined __cplusplus \
? __cplusplus >= 201703L \
- : __STDC_VERSION__ >= 202000L && __clang_major__ >= 16) \
+ : __STDC_VERSION__ >= 202000L && __clang_major__ >= 16 \
+ && !defined __sun) \
: (defined __GNUC__ \
? (defined __cplusplus \
? __cplusplus >= 201103L && __GNUG__ >= 6 \
- : __STDC_VERSION__ >= 202000L && __GNUC__ >= 13) \
+ : __STDC_VERSION__ >= 202000L && __GNUC__ >= 13 \
+ && !defined __sun) \
: defined HAVE_C_STATIC_ASSERT)) \
&& !defined assert \
&& (!defined __cplusplus \
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index a07738479d4..d0a67608114 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -1,5 +1,5 @@
# string_h.m4
-# serial 39
+# serial 43
dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -70,6 +70,8 @@ AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSTR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASESTR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOK_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STR_STARTSWITH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STR_ENDSWITH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSLEN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNLEN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCHR])
@@ -84,6 +86,8 @@ AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSPN])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSEP])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOK_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBS_STARTSWITH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBS_ENDSWITH])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_R])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERRORNAME_NP])
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index 75e97485724..fb69209b4dc 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
# sys_socket_h.m4
-# serial 29
+# serial 31
dnl Copyright (C) 2005-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -53,24 +53,10 @@ AC_DEFUN_ONCE([gl_SYS_SOCKET_H],
fi
# We need to check for ws2tcpip.h now.
gl_PREREQ_SYS_H_SOCKET
- AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
- /* sys/types.h is not needed according to POSIX, but the
- sys/socket.h in i386-unknown-freebsd4.10 and
- powerpc-apple-darwin5.5 required it. */
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-])
+ gl_PREREQ_SYS_SA_FAMILY
if test $ac_cv_type_struct_sockaddr_storage = no; then
HAVE_STRUCT_SOCKADDR_STORAGE=0
fi
- if test $ac_cv_type_sa_family_t = no; then
- HAVE_SA_FAMILY_T=0
- fi
if test $ac_cv_type_struct_sockaddr_storage != no; then
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
[],
@@ -159,6 +145,32 @@ AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP],
AC_SUBST([HAVE_WS2TCPIP_H])
])
+# Common prerequisites of the <sys/socket.h> replacement and of the <sys/un.h>
+# replacement.
+# Sets and substitutes HAVE_SA_FAMILY_T.
+AC_DEFUN([gl_PREREQ_SYS_SA_FAMILY],
+[
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+ if test $ac_cv_type_sa_family_t = yes; then
+ HAVE_SA_FAMILY_T=1
+ else
+ HAVE_SA_FAMILY_T=0
+ fi
+ AC_SUBST([HAVE_SA_FAMILY_T])
+])
+
# gl_SYS_SOCKET_MODULE_INDICATOR([modulename])
# sets the shell variable that indicates the presence of the given module
# to a C preprocessor expression that will evaluate to 1.
@@ -203,6 +215,5 @@ AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
- HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T])
HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4])
])