# HG changeset patch # User Bruno Haible # Date 1304162395 -7200 # Node ID fc75a382e7cddfced417a89566078e5edb47d61a # Parent e71d1b99c2f4a7b3ee4fc313a323f22390790721 sys_uio: Protect definition of 'struct iovec'. * lib/sys_uio.in.h (struct iovec): Avoid redefinition. In C++, define it as a C struct. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-04-30 Bruno Haible + + sys_uio: Protect definition of 'struct iovec'. + * lib/sys_uio.in.h (struct iovec): Avoid redefinition. In C++, define + it as a C struct. + 2011-04-30 Bruno Haible manywarnings: fix indentation diff --git a/lib/sys_uio.in.h b/lib/sys_uio.in.h --- a/lib/sys_uio.in.h +++ b/lib/sys_uio.in.h @@ -37,12 +37,24 @@ /* Get 'ssize_t'. */ # include +# ifdef __cplusplus +extern "C" { +# endif + +# if !GNULIB_defined_struct_iovec /* All known platforms that lack also lack any declaration of struct iovec in any other header. */ struct iovec { void *iov_base; size_t iov_len; }; +# define GNULIB_defined_struct_iovec 1 +# endif + +# ifdef __cplusplus +} +# endif + #endif #endif /* _GL_SYS_UIO_H */