From f6d96fbe1b150454928ffe80ac34fef4271d1761 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 4 Jul 2011 16:26:08 +1000 Subject: [PATCH] Expose mapped_file only if mmap is available --- io.cpp | 6 ++++-- io.hpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/io.cpp b/io.cpp index 7bc836ec..14b02716 100644 --- a/io.cpp +++ b/io.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include @@ -68,6 +67,9 @@ fd_ref::operator int (void) const { return fd; } +#if defined(HAVE_MMAP) +#include + //---------------------------------------------------------------------------- mapped_file::mapped_file (const char *_path): m_fd (open (_path, O_RDONLY)) @@ -119,6 +121,6 @@ mapped_file::data (void) const { return m_data; } - +#endif diff --git a/io.hpp b/io.hpp index c7931eb5..65e5ed11 100644 --- a/io.hpp +++ b/io.hpp @@ -52,6 +52,7 @@ struct fd_ref { }; +#if defined(HAVE_MMAP) /// Wraps a mechanism to map a file into memory. Read only. class mapped_file { protected: @@ -74,6 +75,7 @@ class mapped_file { const uint8_t* data (void) const; size_t size (void) const; }; +#endif #endif