summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-02-20 09:30:44 -0500
committergit <svn-admin@ruby-lang.org>2024-02-20 14:31:03 +0000
commitbcfcdae58e439eb960ef02cc03f894f34712862d (patch)
tree9012b7814f95ae34fa064f8478eb58aaaaab98ec
parentf0a46c63341336c19a9c8237c65c762ebef99b04 (diff)
[ruby/prism] Fix windows build checking for _POSIX_MAPPED_FILES
https://github.com/ruby/prism/commit/acf603603f
-rw-r--r--prism/defines.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/prism/defines.h b/prism/defines.h
index 66c644939f..0abfa86e66 100644
--- a/prism/defines.h
+++ b/prism/defines.h
@@ -15,7 +15,6 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
/**
* We want to be able to use the PRI* macros for printing out integers, but on
@@ -105,8 +104,13 @@
* If the target platform is POSIX or Windows, we can map a file in memory and
* read it in a more efficient manner.
*/
-#if defined(_POSIX_MAPPED_FILES) || defined(_WIN32)
+#ifdef _WIN32
# define PRISM_HAS_MMAP
+#else
+# include <unistd.h>
+# ifdef _POSIX_MAPPED_FILES
+# define PRISM_HAS_MMAP
+# endif
#endif
#endif