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
This commit is contained in:
snappy.mirrorbot@gmail.com 2011-03-24 19:12:27 +00:00
parent 48662cbb7f
commit 2e182e9bb8
3 changed files with 9 additions and 1 deletions

View File

@ -18,7 +18,7 @@ AC_SUBST([LIBTOOL_DEPS])
AC_PROG_CXX AC_PROG_CXX
AC_LANG([C++]) AC_LANG([C++])
AC_C_BIGENDIAN 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, # 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). # which we don't need (and does not exist on Windows).

View File

@ -23,7 +23,10 @@
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_SYS_MMAN
#include <sys/mman.h> #include <sys/mman.h>
#endif
#include "config.h" #include "config.h"
#include "snappy-stubs-public.h" #include "snappy-stubs-public.h"

View File

@ -21,6 +21,11 @@
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/time.h> #include <sys/time.h>