From: Bruno Haible Date: Sat, 30 Apr 2011 11:19:55 +0000 (+0200) Subject: sys_uio: Protect definition of 'struct iovec'. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9b4d37004240533b0aab80806cc8539140e4fd1;p=pspp 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 index 6a9857e767..b567940fb7 100644 --- 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 index 175ee0fb6d..faad3de206 100644 --- 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 */