From 76037fe0aa29ec51fe41782ca876de5c26e29877 Mon Sep 17 00:00:00 2001 From: Artem Dinaburg Date: Fri, 18 Mar 2016 15:01:41 -0400 Subject: [PATCH] Define constants for _open and silence some warnings --- src/windows/port.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/windows/port.h b/src/windows/port.h index 56b172b6b..e711debda 100755 --- a/src/windows/port.h +++ b/src/windows/port.h @@ -70,8 +70,11 @@ * 4715: for some reason VC++ stopped realizing you can't return after abort() * 4800: we know we're casting ints/char*'s to bools, and we're ok with that * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror() + * 4312: Converting uint32_t to a pointer when testing %p + * 4267: also subtracting two size_t to int + * 4722: Destructor never returns due to abort() */ -#pragma warning(disable:4244 4251 4355 4715 4800 4996) +#pragma warning(disable:4244 4251 4355 4715 4800 4996 4267 4312 4722) /* file I/O */ #define PATH_MAX 1024 @@ -86,6 +89,11 @@ #define pclose _pclose #define R_OK 04 /* read-only (for access()) */ #define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) + +#define O_WRONLY _O_WRONLY +#define O_CREAT _O_CREAT +#define O_EXCL _O_EXCL + #ifndef __MINGW32__ enum { STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2 }; #endif