summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas <Coquinho@users.noreply.github.com>2020-07-22 15:23:59 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-12-15 16:10:26 -0300
commitb0fbb1020870b445a80dcbaf120d87985d2d8b54 (patch)
treea976b2126eab2d469063468ce68a7035b3b19e1e
parentedb195cfd28b0c09bda888d2f05d8fc808a5cd2f (diff)
downloadefl-b0fbb1020870b445a80dcbaf120d87985d2d8b54.tar.gz
evil: Define file creation flags and file status flags for fcntl
UCRT `fcntl.h` already define those as `_<FLAG>` and by defining `_CRT_DECLARE_NONSTDC_NAMES` it does a `#define _<FLAG> <FLAG>` making them available the way a POSIX system expects.
-rw-r--r--src/lib/evil/evil_fcntl.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/evil/evil_fcntl.h b/src/lib/evil/evil_fcntl.h
index 1930a18e7f..f988de5fe9 100644
--- a/src/lib/evil/evil_fcntl.h
+++ b/src/lib/evil/evil_fcntl.h
@@ -4,6 +4,19 @@
# include <sys/types.h>
+#if _MSC_VER
+# define _CRT_DECLARE_NONSTDC_NAMES 1
+# include <fcntl.h>
+# undef _CRT_DECLARE_NONSTDC_NAMES
+#endif
+
+/**
+ * @def O_ACCMODE
+ * O_ACCMODE is an AND mask to extract file access modes.
+ */
+#ifdef _MSC_VER
+# define O_ACCMODE 3
+#endif
/**
* @def FD_CLOEXEC