Skip to content

Commit 748abc4

Browse files
artemdinaburgNeroBurner
authored andcommitted
Define constants for _open and silence some warnings
1 parent cc12894 commit 748abc4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/windows/port.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@
7070
* 4715: for some reason VC++ stopped realizing you can't return after abort()
7171
* 4800: we know we're casting ints/char*'s to bools, and we're ok with that
7272
* 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
73+
* 4312: Converting uint32_t to a pointer when testing %p
74+
* 4267: also subtracting two size_t to int
75+
* 4722: Destructor never returns due to abort()
7376
*/
74-
#pragma warning(disable:4244 4251 4355 4715 4800 4996)
77+
#pragma warning(disable:4244 4251 4355 4715 4800 4996 4267 4312 4722)
7578

7679
/* file I/O */
7780
#define PATH_MAX 1024
@@ -86,6 +89,11 @@
8689
#define pclose _pclose
8790
#define R_OK 04 /* read-only (for access()) */
8891
#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
92+
93+
#define O_WRONLY _O_WRONLY
94+
#define O_CREAT _O_CREAT
95+
#define O_EXCL _O_EXCL
96+
8997
#ifndef __MINGW32__
9098
enum { STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2 };
9199
#endif

0 commit comments

Comments
 (0)