From 15c4a85a1422fe567a2eeb1b0871c50a4e99bb9e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 25 Jul 2024 00:41:00 +0200 Subject: [PATCH] Avoid false socket_used_without_requesting_gnulib_module_connect. * modules/connect (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_socket.in.h (connect): Don't define to socket_used_without_requesting_gnulib_module_connect if the gnulib module 'connect' is in use under the same configure.ac. Fix typo. --- ChangeLog | 6 ++++++ lib/sys_socket.in.h | 6 ++++-- modules/connect | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3b4a3b44b..ce93bbb1dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2024-07-24 Bruno Haible + Avoid false socket_used_without_requesting_gnulib_module_connect. + * modules/connect (configure.ac): Invoke gl_MODULE_INDICATOR. + * lib/sys_socket.in.h (connect): Don't define to + socket_used_without_requesting_gnulib_module_connect if the gnulib + module 'connect' is in use under the same configure.ac. Fix typo. + 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 diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index 28b2d6c0e0..19c919c131 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -328,8 +328,10 @@ _GL_CXXALIAS_SYS_CAST (connect, int, # endif _GL_CXXALIASWARN (connect); #elif @HAVE_WINSOCK2_H@ -# undef connect -# define connect socket_used_without_requesting_gnulib_module_connect +# if !GNULIB_CONNECT +# undef connect +# define connect connect_used_without_requesting_gnulib_module_connect +# endif #elif defined GNULIB_POSIXCHECK # undef connect # if HAVE_RAW_DECL_CONNECT diff --git a/modules/connect b/modules/connect index cd21697b75..d56088f30f 100644 --- a/modules/connect +++ b/modules/connect @@ -15,6 +15,7 @@ configure.ac: AC_REQUIRE([gl_SYS_SOCKET_H]) gl_CONDITIONAL([GL_COND_OBJ_CONNECT], [test "$ac_cv_header_winsock2_h" = yes]) gl_SYS_SOCKET_MODULE_INDICATOR([connect]) +gl_MODULE_INDICATOR([connect]) Makefile.am: if GL_COND_OBJ_CONNECT -- 2.39.5