aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/Makefile.am1
-rw-r--r--include/compat/fcntl.h32
2 files changed, 33 insertions, 0 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index 9f42f05..728d921 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -8,6 +8,7 @@ noinst_HEADERS = pqueue.h
8noinst_HEADERS += compat/dirent.h 8noinst_HEADERS += compat/dirent.h
9noinst_HEADERS += compat/dirent_msvc.h 9noinst_HEADERS += compat/dirent_msvc.h
10noinst_HEADERS += compat/err.h 10noinst_HEADERS += compat/err.h
11noinst_HEADERS += compat/fcntl.h
11noinst_HEADERS += compat/limits.h 12noinst_HEADERS += compat/limits.h
12noinst_HEADERS += compat/netdb.h 13noinst_HEADERS += compat/netdb.h
13noinst_HEADERS += compat/poll.h 14noinst_HEADERS += compat/poll.h
diff --git a/include/compat/fcntl.h b/include/compat/fcntl.h
new file mode 100644
index 0000000..99c2d58
--- /dev/null
+++ b/include/compat/fcntl.h
@@ -0,0 +1,32 @@
1/*
2 * Public domain
3 * fcntl.h compatibility shim
4 */
5
6#ifndef _WIN32
7#include_next <fcntl.h>
8#else
9
10#ifdef _MSC_VER
11#if _MSC_VER >= 1900
12#include <../ucrt/fcntl.h>
13#else
14#include <../include/fcntl.h>
15#endif
16#else
17#include_next <fcntl.h>
18#endif
19
20#ifndef O_NONBLOCK
21#define O_NONBLOCK 0x100000
22#endif
23
24#ifndef O_CLOEXEC
25#define O_CLOEXEC 0x200000
26#endif
27
28#ifndef FD_CLOEXEC
29#define FD_CLOEXEC 1
30#endif
31
32#endif