diff options
| author | Brent Cook <busterb@gmail.com> | 2017-01-15 22:28:36 -0600 |
|---|---|---|
| committer | Brent Cook <busterb@gmail.com> | 2017-01-16 10:59:15 -0600 |
| commit | 51a53876b623f751e076fa66cdf2b99df06b2028 (patch) | |
| tree | 494f3eaf6caea2e5ee3eb6ee665d853b699f470a /include | |
| parent | c53c23c5d8a4de5c231a282e1bd70b7f3b1b438f (diff) | |
| download | portable-51a53876b623f751e076fa66cdf2b99df06b2028.tar.gz portable-51a53876b623f751e076fa66cdf2b99df06b2028.tar.bz2 portable-51a53876b623f751e076fa66cdf2b99df06b2028.zip | |
add fcntl shim
Diffstat (limited to 'include')
| -rw-r--r-- | include/Makefile.am | 1 | ||||
| -rw-r--r-- | include/compat/fcntl.h | 32 |
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 | |||
| 8 | noinst_HEADERS += compat/dirent.h | 8 | noinst_HEADERS += compat/dirent.h |
| 9 | noinst_HEADERS += compat/dirent_msvc.h | 9 | noinst_HEADERS += compat/dirent_msvc.h |
| 10 | noinst_HEADERS += compat/err.h | 10 | noinst_HEADERS += compat/err.h |
| 11 | noinst_HEADERS += compat/fcntl.h | ||
| 11 | noinst_HEADERS += compat/limits.h | 12 | noinst_HEADERS += compat/limits.h |
| 12 | noinst_HEADERS += compat/netdb.h | 13 | noinst_HEADERS += compat/netdb.h |
| 13 | noinst_HEADERS += compat/poll.h | 14 | noinst_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 | ||
