[ruby/prism] Fix windows build checking for _POSIX_MAPPED_FILES

https://github.com/ruby/prism/commit/acf603603f
This commit is contained in:
Kevin Newton 2024-02-20 09:30:44 -05:00 committed by git
parent f0a46c6334
commit bcfcdae58e

View File

@ -15,7 +15,6 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h>
/** /**
* We want to be able to use the PRI* macros for printing out integers, but on * 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 * If the target platform is POSIX or Windows, we can map a file in memory and
* read it in a more efficient manner. * read it in a more efficient manner.
*/ */
#if defined(_POSIX_MAPPED_FILES) || defined(_WIN32) #ifdef _WIN32
# define PRISM_HAS_MMAP # define PRISM_HAS_MMAP
#else
# include <unistd.h>
# ifdef _POSIX_MAPPED_FILES
# define PRISM_HAS_MMAP
# endif
#endif #endif
#endif #endif