[Change] Some minor clean up.
This commit is contained in:
parent
a17b7792f3
commit
69ad2fd3bb
10
src/rng.c
10
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user