Skip to content

Commit acf6036

Browse files
committed
Fix windows build checking for _POSIX_MAPPED_FILES
1 parent d0d0a9e commit acf6036

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

include/prism/defines.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <stdint.h>
1616
#include <stdio.h>
1717
#include <string.h>
18-
#include <unistd.h>
1918

2019
/**
2120
* We want to be able to use the PRI* macros for printing out integers, but on
@@ -105,8 +104,13 @@
105104
* If the target platform is POSIX or Windows, we can map a file in memory and
106105
* read it in a more efficient manner.
107106
*/
108-
#if defined(_POSIX_MAPPED_FILES) || defined(_WIN32)
107+
#ifdef _WIN32
109108
# define PRISM_HAS_MMAP
109+
#else
110+
# include <unistd.h>
111+
# ifdef _POSIX_MAPPED_FILES
112+
# define PRISM_HAS_MMAP
113+
# endif
110114
#endif
111115

112116
#endif

0 commit comments

Comments
 (0)