[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) {
|
static uint32_t rng_timeEntropy(void) {
|
||||||
int i;
|
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;
|
struct _timeb tb;
|
||||||
_ftime(&tb);
|
_ftime(&tb);
|
||||||
i = tb.time * 1000 + tb.millitm;
|
i = tb.time * 1000 + tb.millitm;
|
||||||
#else
|
#else
|
||||||
struct timeval tv;
|
#error "Needs Implmentation."
|
||||||
gettimeofday(&tv, NULL);
|
|
||||||
i = tv.tv_sec * 1000000 + tv.tv_usec;
|
|
||||||
#endif
|
#endif
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user