From e747515f715852c67890df4d2af5dd541dabab9b 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 a99e79d970..26590c9cc7 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 afeedf070c..62211e475c 100644 --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -358,7 +358,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 @@ -420,7 +422,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 @@ -452,7 +456,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 @@ -599,7 +605,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