From 062868dcdfd8616c55405d42a065c7504fdcaf7a Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Thu, 8 Apr 2021 14:24:34 +0100 Subject: StormPort.h: Do not assume mmap support Do not assume mmap by default for the fallback platform, unless it's in a list of platforms that we know have mmap Refs #215 --- src/StormPort.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/StormPort.h b/src/StormPort.h index bd7947f..ba78d7f 100644 --- a/src/StormPort.h +++ b/src/StormPort.h @@ -249,13 +249,12 @@ #endif //----------------------------------------------------------------------------- -// Assumption: If the platform is not defined, this must be Linux *grin* +// Assumption: If the platform is not defined, assume a Linux-like platform #if !defined(STORMLIB_PLATFORM_DEFINED) #include #include - #include #include #include #include @@ -273,7 +272,13 @@ #endif #define STORMLIB_LINUX - #define STORMLIB_HAS_MMAP // Indicate that we have mmap support + + // Platforms with mmap support + #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) + #include + #define STORMLIB_HAS_MMAP + #endif + #define STORMLIB_PLATFORM_DEFINED #endif -- cgit v1.2.3