aboutsummaryrefslogtreecommitdiff
path: root/include/compat
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2017-01-15 22:28:36 -0600
committerBrent Cook <busterb@gmail.com>2017-01-16 10:59:15 -0600
commit51a53876b623f751e076fa66cdf2b99df06b2028 (patch)
tree494f3eaf6caea2e5ee3eb6ee665d853b699f470a /include/compat
parentc53c23c5d8a4de5c231a282e1bd70b7f3b1b438f (diff)
downloadportable-51a53876b623f751e076fa66cdf2b99df06b2028.tar.gz
portable-51a53876b623f751e076fa66cdf2b99df06b2028.tar.bz2
portable-51a53876b623f751e076fa66cdf2b99df06b2028.zip
add fcntl shim
Diffstat (limited to 'include/compat')
-rw-r--r--include/compat/fcntl.h32
1 files changed, 32 insertions, 0 deletions
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