From: Bruno Haible Date: Wed, 24 Jul 2024 23:12:43 +0000 (+0200) Subject: Avoid false getsockopt_used_without_requesting_gnulib_module_getsockopt. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=2752918fa8a8c06e06f276d6f17a79a2f12aeb0c;p=gnulib.git Avoid false getsockopt_used_without_requesting_gnulib_module_getsockopt. * modules/getsockopt (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_socket.in.h (getsockopt): Don't define to getsockopt_used_without_requesting_gnulib_module_getsockopt if the gnulib module 'getsockopt' is in use under the same configure.ac. --- diff --git a/ChangeLog b/ChangeLog index 9a48a5e070..f1fcc7306f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2024-07-24 Bruno Haible + Avoid false getsockopt_used_without_requesting_gnulib_module_getsockopt. + * modules/getsockopt (configure.ac): Invoke gl_MODULE_INDICATOR. + * lib/sys_socket.in.h (getsockopt): Don't define to + getsockopt_used_without_requesting_gnulib_module_getsockopt if the + gnulib module 'getsockopt' is in use under the same configure.ac. + Avoid false getsockname_used_without_requesting_gnulib_module_getsockname. * modules/getsockname (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_socket.in.h (getsockname): Don't define to diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index f19403d1f0..ce217cdadb 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -504,8 +504,10 @@ _GL_CXXALIAS_SYS_CAST (getsockopt, int, # endif _GL_CXXALIASWARN (getsockopt); #elif @HAVE_WINSOCK2_H@ -# undef getsockopt -# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt +# if !GNULIB_GETSOCKOPT +# undef getsockopt +# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt +# endif #elif defined GNULIB_POSIXCHECK # undef getsockopt # if HAVE_RAW_DECL_GETSOCKOPT diff --git a/modules/getsockopt b/modules/getsockopt index 7749995a60..26d53f7534 100644 --- a/modules/getsockopt +++ b/modules/getsockopt @@ -18,6 +18,7 @@ AC_REQUIRE([gl_SYS_SOCKET_H]) gl_CONDITIONAL([GL_COND_OBJ_GETSOCKOPT], [test "$ac_cv_header_winsock2_h" = yes]) gl_SYS_SOCKET_MODULE_INDICATOR([getsockopt]) +gl_MODULE_INDICATOR([getsockopt]) Makefile.am: if GL_COND_OBJ_GETSOCKOPT