From: Azat Khuzhin Date: Tue, 27 Apr 2021 06:03:42 +0000 (+0300) Subject: Fix O_RDONLY (_O_RDONLY) under mingw X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86ae44ce4d7a8062b173188ac1f0b1cac3aec67b;p=libevent 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 --- diff --git a/arc4random.c b/arc4random.c index cde22d0a..c36e3c11 100644 --- a/arc4random.c +++ b/arc4random.c @@ -89,6 +89,10 @@ struct arc4_stream { #define pid_t int #endif +#ifndef O_RDONLY +#define O_RDONLY _O_RDONLY +#endif + static int rs_initialized; static struct arc4_stream rs; static pid_t arc4_stir_pid; diff --git a/evutil.c b/evutil.c index 95d426ac..69c6f205 100644 --- a/evutil.c +++ b/evutil.c @@ -109,6 +109,10 @@ #define mode_t int #endif +#ifndef O_RDONLY +#define O_RDONLY _O_RDONLY +#endif + #ifdef EVENT__HAVE_AFUNIX_H int have_working_afunix_ = -1; #endif