From 522203c9f627792ea722aa1f66f6a4761d514969 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 25 Jul 2024 01:12:43 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/sys_socket.in.h | 6 ++++-- modules/getsockopt | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81ea31da1c..5c2d1f68f7 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 -- 2.39.5