Skip to content

Commit 335e132

Browse files
kevinbackhouseneheb
authored andcommitted
Add #error so the build fails if mmap isn't supported.
1 parent 5cabd97 commit 335e132

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/basicio.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ int FileIo::munmap() {
203203
CloseHandle(p_->hFile_);
204204
p_->hFile_ = 0;
205205
#else
206+
#error Platforms without mmap are not supported. See https://github.com/Exiv2/exiv2/issues/2380
206207
if (p_->isWriteable_) {
207208
seek(0, BasicIo::beg);
208209
write(p_->pMappedArea_, p_->mappedLength_);
@@ -275,6 +276,7 @@ byte* FileIo::mmap(bool isWriteable) {
275276
}
276277
p_->pMappedArea_ = static_cast<byte*>(rc);
277278
#else
279+
#error Platforms without mmap are not supported. See https://github.com/Exiv2/exiv2/issues/2380
278280
// Workaround for platforms without mmap: Read the file into memory
279281
byte* buf = new byte[p_->mappedLength_];
280282
const long offset = std::ftell(p_->fp_);

0 commit comments

Comments
 (0)