Skip to content

Commit

Permalink
[ruby/prism] Fix windows build checking for _POSIX_MAPPED_FILES
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton authored and matzbot committed Feb 20, 2024
1 parent f0a46c6 commit bcfcdae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions prism/defines.h
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit bcfcdae

Please sign in to comment.