diff options
Diffstat (limited to 'lib/hcrypto/rand-timer.c')
-rw-r--r-- | lib/hcrypto/rand-timer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/hcrypto/rand-timer.c b/lib/hcrypto/rand-timer.c index 994c3210e941..935a3a7baa2c 100644 --- a/lib/hcrypto/rand-timer.c +++ b/lib/hcrypto/rand-timer.c @@ -32,13 +32,10 @@ */ #include <config.h> +#include <roken.h> -#include <stdio.h> -#include <stdlib.h> #include <rand.h> -#include <roken.h> - #include "randi.h" #ifndef WIN32 /* don't bother with this on windows */ @@ -186,6 +183,16 @@ timer_status(void) #endif } +#if defined(__GNUC__) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901) +const RAND_METHOD hc_rand_timer_method = { + .seed = timer_seed, + .bytes = timer_bytes, + .cleanup = timer_cleanup, + .add = timer_add, + .pseudorand = timer_pseudorand, + .status = timer_status +}; +#else const RAND_METHOD hc_rand_timer_method = { timer_seed, timer_bytes, @@ -194,6 +201,7 @@ const RAND_METHOD hc_rand_timer_method = { timer_pseudorand, timer_status }; +#endif const RAND_METHOD * RAND_timer_method(void) |