From cf272bf1f64341eb3471ca736273fd5ec19e6b28 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 25 Jul 2024 01:16:05 +0200 Subject: [PATCH] Avoid false recv_used_without_requesting_gnulib_module_recv. * modules/recv (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_socket.in.h (recv): Don't define to recv_used_without_requesting_gnulib_module_recv if the gnulib module 'recv' is in use under the same configure.ac. --- ChangeLog | 6 ++++++ lib/sys_socket.in.h | 6 ++++-- modules/recv | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9acf083dc3..d0b045cfe3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2024-07-24 Bruno Haible + Avoid false recv_used_without_requesting_gnulib_module_recv. + * modules/recv (configure.ac): Invoke gl_MODULE_INDICATOR. + * lib/sys_socket.in.h (recv): Don't define to + recv_used_without_requesting_gnulib_module_recv if the gnulib module + 'recv' is in use under the same configure.ac. + Avoid false listen_used_without_requesting_gnulib_module_listen. * modules/listen (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_socket.in.h (listen): Don't define to diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index a5e8ee63e7..7e9562c535 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -558,8 +558,10 @@ _GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags) # endif _GL_CXXALIASWARN (recv); #elif @HAVE_WINSOCK2_H@ -# undef recv -# define recv recv_used_without_requesting_gnulib_module_recv +# if !GNULIB_RECV +# undef recv +# define recv recv_used_without_requesting_gnulib_module_recv +# endif #elif defined GNULIB_POSIXCHECK # undef recv # if HAVE_RAW_DECL_RECV diff --git a/modules/recv b/modules/recv index 8c27a42208..18d81bba88 100644 --- a/modules/recv +++ b/modules/recv @@ -15,6 +15,7 @@ configure.ac: AC_REQUIRE([gl_SYS_SOCKET_H]) gl_CONDITIONAL([GL_COND_OBJ_RECV], [test "$ac_cv_header_winsock2_h" = yes]) gl_SYS_SOCKET_MODULE_INDICATOR([recv]) +gl_MODULE_INDICATOR([recv]) Makefile.am: if GL_COND_OBJ_RECV -- 2.39.5