From 69ad2fd3bb99fb002215d5b99b930dec701a89aa Mon Sep 17 00:00:00 2001 From: Allanis Date: Thu, 10 Apr 2014 18:23:54 +0100 Subject: [PATCH] [Change] Some minor clean up. --- src/rng.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rng.c b/src/rng.c index 8f3a74a..46f50db 100644 --- a/src/rng.c +++ b/src/rng.c @@ -71,14 +71,16 @@ void rng_init(void) { static uint32_t rng_timeEntropy(void) { int i; -#ifdef WIN32 +#if defined(_POSIX_SOURCE) + struct timeval tv; + gettimeofday(&tv, NULL); + i = tv.tv_sec * 1000000 + tv.tv_usec; +#elif defined(WIN32) struct _timeb tb; _ftime(&tb); i = tb.time * 1000 + tb.millitm; #else - struct timeval tv; - gettimeofday(&tv, NULL); - i = tv.tv_sec * 1000000 + tv.tv_usec; +#error "Needs Implmentation." #endif return i; }