From c9c820ff36b0d80b85fe17447d512201d3f23185 Mon Sep 17 00:00:00 2001 From: CoderRC <108188026+CoderRC@users.noreply.github.com> Date: Tue, 28 Mar 2023 17:26:25 -0400 Subject: [PATCH] Added support for _POSIX_MAPPED_FILES if defined in source (#564) --- main.cpp | 2 ++ mmap.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index a82ace48d..f86be6ac3 100644 --- a/main.cpp +++ b/main.cpp @@ -24,6 +24,8 @@ #include #include #include +#elif defined (_POSIX_MAPPED_FILES) +#include #endif #define ROUNDUP(X, K) (((X) + (K)-1) & -(K)) diff --git a/mmap.h b/mmap.h index 8bdd662d3..7850fee32 100644 --- a/mmap.h +++ b/mmap.h @@ -8,11 +8,12 @@ #include #include + #ifdef __cplusplus extern "C" { #endif -#ifdef _MSC_VER +#if defined (_MSC_VER) && !(defined (_POSIX_MAPPED_FILES)) #define NEED_WIN32_MMAP #include #include