From: Bruno Haible Date: Tue, 24 Dec 2024 10:21:51 +0000 (+0100) Subject: sys_socket: Support several gnulib-tool invocations better. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e095b4f2f55b1311ce170de5e014ba24325f0a91;p=thirdparty%2Fgnulib.git sys_socket: Support several gnulib-tool invocations better. * lib/sys_socket.in.h (_GL_ALREADY_INCLUDING_SYS_SOCKET_H): Rename to a macro that depends on GUARD_PREFIX. (struct msghdr): Avoid duplicate definition. --- diff --git a/ChangeLog b/ChangeLog index 5037f1bbc5..bec6cc301e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-12-24 Bruno Haible + + sys_socket: Support several gnulib-tool invocations better. + * lib/sys_socket.in.h (_GL_ALREADY_INCLUDING_SYS_SOCKET_H): Rename to a + macro that depends on GUARD_PREFIX. + (struct msghdr): Avoid duplicate definition. + 2024-12-24 Bruno Haible string: Support several gnulib-tool invocations better. diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index 2be986659f..9610a52647 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -27,7 +27,7 @@ #endif @PRAGMA_COLUMNS@ -#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H +#if defined _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H /* Special invocation convention: - On Cygwin 1.5.x we have a sequence of nested includes -> -> -> , @@ -43,7 +43,7 @@ #if @HAVE_SYS_SOCKET_H@ -# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H +# define _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H /* On many platforms, assumes prior inclusion of . */ @@ -56,7 +56,7 @@ /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ -# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H +# undef _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H #endif @@ -202,6 +202,7 @@ struct sockaddr_storage /* Rudimentary 'struct msghdr'; this works as long as you don't try to access msg_control or msg_controllen. */ +# if !defined GNULIB_defined_struct_msghdr struct msghdr { void *msg_name; socklen_t msg_namelen; @@ -209,6 +210,8 @@ struct msghdr { int msg_iovlen; int msg_flags; }; +# define GNULIB_defined_struct_msghdr 1 +# endif #endif