From: Bruno Haible Date: Wed, 24 Jul 2024 22:41:00 +0000 (+0200) Subject: Avoid false socket_used_without_requesting_gnulib_module_connect. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=eae3d2b70be7e0a1cc8323b2bf7dbe97bb070012;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 57c9b175ed..b220aca902 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