From 968afdfa913be2926c245ae278d14cb4c4200947 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 18 Aug 2023 17:25:26 +0200 Subject: [PATCH] sys_socket: Fix compilation errors in C++ mode on AIX 7.3 with gcc. * lib/sys_socket.in.h (accept, getpeername, getsockname, recvfrom): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 6 ++++++ lib/sys_socket.in.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4971d96674..21d6ded942 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-08-18 Bruno Haible + + sys_socket: Fix compilation errors in C++ mode on AIX 7.3 with gcc. + * lib/sys_socket.in.h (accept, getpeername, getsockname, recvfrom): + Disable _GL_CXXALIASWARN invocation on non-glibc systems. + 2023-08-18 Bruno Haible stddef: Don't unnecessarily override max_align_t on AIX 7.3 with gcc. diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index 6705593f4a..859a9bb66b 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -355,7 +355,9 @@ _GL_CXXALIAS_SYS_CAST (accept, int, struct sockaddr *restrict addr, socklen_t *restrict addrlen)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (accept); +# endif #elif @HAVE_WINSOCK2_H@ # undef accept # define accept accept_used_without_requesting_gnulib_module_accept @@ -417,7 +419,9 @@ _GL_CXXALIAS_SYS_CAST (getpeername, int, (int fd, struct sockaddr *restrict addr, socklen_t *restrict addrlen)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (getpeername); +# endif #elif @HAVE_WINSOCK2_H@ # undef getpeername # define getpeername getpeername_used_without_requesting_gnulib_module_getpeername @@ -449,7 +453,9 @@ _GL_CXXALIAS_SYS_CAST (getsockname, int, (int fd, struct sockaddr *restrict addr, socklen_t *restrict addrlen)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (getsockname); +# endif #elif @HAVE_WINSOCK2_H@ # undef getsockname # define getsockname getsockname_used_without_requesting_gnulib_module_getsockname @@ -596,7 +602,9 @@ _GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t, struct sockaddr *restrict from, socklen_t *restrict fromlen)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (recvfrom); +# endif #elif @HAVE_WINSOCK2_H@ # undef recvfrom # define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom -- 2.39.5