Skip to content

Commit

Permalink
Define constants for _open and silence some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
artemdinaburg authored and NeroBurner committed Jun 20, 2018
1 parent b54793d commit f39f78c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/windows/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f39f78c

Please sign in to comment.