From: Nick Mathewson Date: Thu, 25 Feb 2010 22:14:41 +0000 (-0500) Subject: Fix arc4random compilation on MSVC. X-Git-Tag: release-2.0.4-alpha~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98edb891f89911ab5bdfa2a26ba2c549c66a3b1f;p=libevent Fix arc4random compilation on MSVC. --- diff --git a/Makefile.nmake b/Makefile.nmake index 80a0c110..da418e20 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -14,7 +14,7 @@ LIBFLAGS=/nologo CORE_OBJS=event.obj buffer.obj bufferevent.obj bufferevent_sock.obj \ bufferevent_pair.obj listener.obj evmap.obj log.obj evutil.obj \ strlcpy.obj signal.obj bufferevent_filter.obj evthread.obj \ - bufferevent_ratelim.obj + bufferevent_ratelim.obj evutil_rand.obj WIN_OBJS=win32select.obj evthread_win32.obj buffer_iocp.obj \ event_iocp.obj bufferevent_async.obj EXTRA_OBJS=event_tagging.obj http.obj evdns.obj evrpc.obj diff --git a/arc4random.c b/arc4random.c index c14fc536..28f0cdbf 100644 --- a/arc4random.c +++ b/arc4random.c @@ -74,6 +74,11 @@ struct arc4_stream { unsigned char s[256]; }; +#ifdef WIN32 +#define getpid _getpid +#define pid_t int +#endif + static int rs_initialized; static struct arc4_stream rs; static pid_t arc4_stir_pid; @@ -217,9 +222,6 @@ arc4_stir(void) arc4_count = BYTES_BEFORE_RESEED; } -#ifdef WIN32 -#define getpid _getpid -#endif static void arc4_stir_if_needed(void)