summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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