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; }