From a09de1308a24d618ee756de3bcf6609d26342ef2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 25 Jul 2024 00:38:08 +0200 Subject: [PATCH] Avoid false socket_used_without_requesting_gnulib_module_socket. * modules/socket (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_socket.in.h (socket): Don't define to socket_used_without_requesting_gnulib_module_socket if the gnulib module 'socket' is in use under the same configure.ac. --- ChangeLog | 6 ++++++ lib/sys_socket.in.h | 6 ++++-- modules/socket | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb5f227535..c3b4a3b44b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2024-07-24 Bruno Haible + Avoid false socket_used_without_requesting_gnulib_module_socket. + * modules/socket (configure.ac): Invoke gl_MODULE_INDICATOR. + * lib/sys_socket.in.h (socket): Don't define to + socket_used_without_requesting_gnulib_module_socket if the gnulib module + 'socket' is in use under the same configure.ac. + Avoid false lstat_used_without_requesting_gnulib_module_lstat. * modules/lstat (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_stat.in.h (lstat): Don't define to diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index 13833c0fa6..28b2d6c0e0 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -296,8 +296,10 @@ _GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol)); # endif _GL_CXXALIASWARN (socket); #elif @HAVE_WINSOCK2_H@ -# undef socket -# define socket socket_used_without_requesting_gnulib_module_socket +# if !GNULIB_SOCKET +# undef socket +# define socket socket_used_without_requesting_gnulib_module_socket +# endif #elif defined GNULIB_POSIXCHECK # undef socket # if HAVE_RAW_DECL_SOCKET diff --git a/modules/socket b/modules/socket index 3670c6b839..a67025aa6b 100644 --- a/modules/socket +++ b/modules/socket @@ -25,6 +25,7 @@ if test "$ac_cv_header_winsock2_h" = yes; then SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 fi gl_SYS_SOCKET_MODULE_INDICATOR([socket]) +gl_MODULE_INDICATOR([socket]) Makefile.am: if GL_COND_OBJ_SOCKET -- 2.39.5