summaryrefslogtreecommitdiffstats
path: root/gl/m4/sockpfaf.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/sockpfaf.m4')
-rw-r--r--gl/m4/sockpfaf.m416
1 files changed, 14 insertions, 2 deletions
diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
index 6c6dc2f7..08ce843d 100644
--- a/gl/m4/sockpfaf.m4
+++ b/gl/m4/sockpfaf.m4
@@ -1,8 +1,10 @@
1# sockpfaf.m4 serial 10 1# sockpfaf.m4
2dnl Copyright (C) 2004, 2006, 2009-2023 Free Software Foundation, Inc. 2# serial 11
3dnl Copyright (C) 2004, 2006, 2009-2025 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
6 8
7dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...) 9dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...)
8dnl and some common address families (AF_INET, AF_INET6, ...). 10dnl and some common address families (AF_INET, AF_INET6, ...).
@@ -63,6 +65,13 @@ AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
63 AC_REQUIRE([gl_SYS_SOCKET_H]) 65 AC_REQUIRE([gl_SYS_SOCKET_H])
64 AC_CHECK_HEADERS_ONCE([sys/un.h]) 66 AC_CHECK_HEADERS_ONCE([sys/un.h])
65 67
68 dnl Windows versions released after 2017 may have support for AF_UNIX.
69 dnl Including it requires types from <winsock2.h> to be defined.
70 dnl <https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/>.
71 if test "$ac_cv_header_winsock2_h" = yes; then
72 AC_CHECK_HEADERS([afunix.h], [], [], [#include <winsock2.h>])
73 fi
74
66 AC_CACHE_CHECK([for UNIX domain sockets], 75 AC_CACHE_CHECK([for UNIX domain sockets],
67 [gl_cv_socket_unix], 76 [gl_cv_socket_unix],
68 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 77 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
@@ -74,6 +83,9 @@ AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
74#endif 83#endif
75#ifdef HAVE_WINSOCK2_H 84#ifdef HAVE_WINSOCK2_H
76#include <winsock2.h> 85#include <winsock2.h>
86#endif
87#ifdef HAVE_AFUNIX_H
88#include <afunix.h>
77#endif]], 89#endif]],
78[[int x = AF_UNIX; struct sockaddr_un y; 90[[int x = AF_UNIX; struct sockaddr_un y;
79 if (&x && &y) return 0;]])], 91 if (&x && &y) return 0;]])],