From 335e13251ef5d07a3a41fe26199ad7c7b34a9fa1 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Sun, 23 Oct 2022 15:14:09 +0100 Subject: [PATCH] Add #error so the build fails if mmap isn't supported. --- src/basicio.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/basicio.cpp b/src/basicio.cpp index 5916addc..5d1c342b 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -203,6 +203,7 @@ int FileIo::munmap() { CloseHandle(p_->hFile_); p_->hFile_ = 0; #else +#error Platforms without mmap are not supported. See https://github.com/Exiv2/exiv2/issues/2380 if (p_->isWriteable_) { seek(0, BasicIo::beg); write(p_->pMappedArea_, p_->mappedLength_); @@ -275,6 +276,7 @@ byte* FileIo::mmap(bool isWriteable) { } p_->pMappedArea_ = static_cast(rc); #else +#error Platforms without mmap are not supported. See https://github.com/Exiv2/exiv2/issues/2380 // Workaround for platforms without mmap: Read the file into memory byte* buf = new byte[p_->mappedLength_]; const long offset = std::ftell(p_->fp_);