Skip to content

Commit 86ae44c

Browse files
committed
Fix O_RDONLY (_O_RDONLY) under mingw
O_RDONLY is defined only if [1]: !defined(NO_OLDNAMES) || defined(_POSIX) [1]: https://github.com/Alexpux/mingw-w64/blob/d0d7f784833bbb0b2d279310ddc6afb52fe47a46/mingw-w64-headers/crt/fcntl.h#L35
1 parent 4f8a614 commit 86ae44c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

arc4random.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ struct arc4_stream {
8989
#define pid_t int
9090
#endif
9191

92+
#ifndef O_RDONLY
93+
#define O_RDONLY _O_RDONLY
94+
#endif
95+
9296
static int rs_initialized;
9397
static struct arc4_stream rs;
9498
static pid_t arc4_stir_pid;

evutil.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@
109109
#define mode_t int
110110
#endif
111111

112+
#ifndef O_RDONLY
113+
#define O_RDONLY _O_RDONLY
114+
#endif
115+
112116
#ifdef EVENT__HAVE_AFUNIX_H
113117
int have_working_afunix_ = -1;
114118
#endif

0 commit comments

Comments
 (0)