From 111e3d3d9cb6d59f0b2097c6641a7694a86edae5 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 25 Nov 2014 13:27:43 -0800 Subject: [PATCH] Only Windows doesn't have . This should probably be in libcutils instead, so code that needs to care about Windows can use readv/writev. Change-Id: I7c2ceec3f742cee0e44f69fd4c88459376bd0e08 --- include/log/uio.h | 13 ++++++++----- liblog/uio.c | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/log/uio.h b/include/log/uio.h index a71f515e0..7059da5f7 100644 --- a/include/log/uio.h +++ b/include/log/uio.h @@ -14,20 +14,23 @@ * limitations under the License. */ -// -// implementation of sys/uio.h for platforms that don't have it (Win32) -// #ifndef _LIBS_CUTILS_UIO_H #define _LIBS_CUTILS_UIO_H -#ifdef HAVE_SYS_UIO_H +#if !defined(_WIN32) + #include + #else #ifdef __cplusplus extern "C" { #endif +// +// Implementation of sys/uio.h for Win32. +// + #include struct iovec { @@ -42,7 +45,7 @@ extern int writev( int fd, const struct iovec* vecs, int count ); } #endif -#endif /* !HAVE_SYS_UIO_H */ +#endif #endif /* _LIBS_UTILS_UIO_H */ diff --git a/liblog/uio.c b/liblog/uio.c index 24a65075f..f77cc492e 100644 --- a/liblog/uio.c +++ b/liblog/uio.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef HAVE_SYS_UIO_H +#if defined(_WIN32) #include #include @@ -73,4 +73,4 @@ Exit: return total; } -#endif /* !HAVE_SYS_UIO_H */ +#endif