aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2021-04-08 14:24:34 +0100
committerGitHub <noreply@github.com>2021-04-08 14:24:34 +0100
commit062868dcdfd8616c55405d42a065c7504fdcaf7a (patch)
treec0a65f37933353e51931c004b07b105bc1b83211 /src
parent95fabe8c0936e013d8764858d6eaf17b6a774e12 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/StormPort.h11
1 files 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 <sys/types.h>
#include <sys/stat.h>
- #include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
@@ -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 <sys/mman.h>
+ #define STORMLIB_HAS_MMAP
+ #endif
+
#define STORMLIB_PLATFORM_DEFINED
#endif