Skip to content

Commit

Permalink
Fix arc4random compilation on MSVC.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmathewson committed Feb 25, 2010
1 parent 1e14f82 commit 98edb89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile.nmake
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions arc4random.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 98edb89

Please sign in to comment.