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