From 2e182e9bb840737f9cd8817e859dc17a82f2c16b Mon Sep 17 00:00:00 2001 From: "snappy.mirrorbot@gmail.com" Date: Thu, 24 Mar 2011 19:12:27 +0000 Subject: [PATCH] Make the unit test work on systems without mmap(). This is required for, among others, Windows support. For Windows in specific, we could have used CreateFileMapping/MapViewOfFile, but this should at least get us a bit closer to compiling, and is of course also relevant for embedded systems with no MMU. (Part 1/2) R=csilvers DELTA=9 (8 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1031 git-svn-id: https://snappy.googlecode.com/svn/trunk@15 03e5f5b5-db94-4691-08a0-1a8bf15f6143 --- configure.ac | 2 +- snappy-stubs-internal.h | 3 +++ snappy-test.h | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7081445..4e938d8 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ AC_SUBST([LIBTOOL_DEPS]) AC_PROG_CXX AC_LANG([C++]) AC_C_BIGENDIAN -AC_CHECK_HEADERS([stdint.h stddef.h]) +AC_CHECK_HEADERS([stdint.h stddef.h sys/mman.h]) # Don't use AC_FUNC_MMAP, as it checks for mappings of already-mapped memory, # which we don't need (and does not exist on Windows). diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h index 28019e4..5a96378 100644 --- a/snappy-stubs-internal.h +++ b/snappy-stubs-internal.h @@ -23,7 +23,10 @@ #include #include #include + +#ifdef HAVE_SYS_MMAN #include +#endif #include "config.h" #include "snappy-stubs-public.h" diff --git a/snappy-test.h b/snappy-test.h index 1bcc69a..48e2215 100644 --- a/snappy-test.h +++ b/snappy-test.h @@ -21,6 +21,11 @@ #include #include + +#ifdef HAVE_SYS_MMAN_H +#include +#endif + #include #include