summaryrefslogtreecommitdiff
path: root/snappy-stubs-public.h.in
diff options
context:
space:
mode:
authorsnappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143>2013-06-13 16:19:52 +0000
committersnappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143>2013-06-13 16:19:52 +0000
commitcf06b4fcc069158624d4984e67e408152eb91382 (patch)
treed2ac73f30752dff890cad9e1608156049438d692 /snappy-stubs-public.h.in
parent72c54da325fc1ad437d1fabddef15523db860ac0 (diff)
downloadsnappy-cf06b4fcc069158624d4984e67e408152eb91382.tar.gz
Add support for uncompressing to iovecs (scatter I/O).
Windows does not have struct iovec defined anywhere, so we define our own version that's equal to what UNIX typically has. The bulk of this patch was contributed by Mohit Aron. R=jeff git-svn-id: http://snappy.googlecode.com/svn/trunk@76 03e5f5b5-db94-4691-08a0-1a8bf15f6143
Diffstat (limited to 'snappy-stubs-public.h.in')
-rw-r--r--snappy-stubs-public.h.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/snappy-stubs-public.h.in b/snappy-stubs-public.h.in
index f0babcb..6c181a1 100644
--- a/snappy-stubs-public.h.in
+++ b/snappy-stubs-public.h.in
@@ -44,6 +44,10 @@
#include <stddef.h>
#endif
+#if @ac_cv_have_sys_uio_h@
+#include <sys/uio.h>
+#endif
+
#define SNAPPY_MAJOR @SNAPPY_MAJOR@
#define SNAPPY_MINOR @SNAPPY_MINOR@
#define SNAPPY_PATCHLEVEL @SNAPPY_PATCHLEVEL@
@@ -80,6 +84,15 @@ typedef std::string string;
TypeName(const TypeName&); \
void operator=(const TypeName&)
+#if !@ac_cv_have_sys_uio_h@
+// Windows does not have an iovec type, yet the concept is universally useful.
+// It is simple to define it ourselves, so we put it inside our own namespace.
+struct iovec {
+ void* iov_base;
+ size_t iov_len;
+};
+#endif
+
} // namespace snappy
#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_