|
From: Nick M. <ni...@us...> - 2010-02-25 22:15:29
|
Author: Nick Mathewson <ni...@to...>
Date: Thu, 25 Feb 2010 17:14:41 -0500
Subject: Fix arc4random compilation on MSVC.
Commit: 98edb891f89911ab5bdfa2a26ba2c549c66a3b1f
---
Makefile.nmake | 2 +-
arc4random.c | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/Makefile.nmake b/Makefile.nmake
index 80a0c11..da418e2 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 c14fc53..28f0cdb 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)
--
1.6.3
|