diff --git a/lib/hcrypto/rand-fortuna.c b/lib/hcrypto/rand-fortuna.c index bca124303..76c9a6055 100644 --- a/lib/hcrypto/rand-fortuna.c +++ b/lib/hcrypto/rand-fortuna.c @@ -622,6 +622,16 @@ fortuna_status(void) return result ? 1 : 0; } +#if defined(__GUNC__) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901) +const RAND_METHOD hc_rand_fortuna_method = { + .seed = fortuna_seed, + .bytes = fortuna_bytes, + .cleanup = fortuna_cleanup, + .add = fortuna_add, + .pseudorand = fortuna_pseudorand, + .status = fortuna_status +}; +#else const RAND_METHOD hc_rand_fortuna_method = { fortuna_seed, fortuna_bytes, @@ -630,6 +640,7 @@ const RAND_METHOD hc_rand_fortuna_method = { fortuna_pseudorand, fortuna_status }; +#endif const RAND_METHOD * RAND_fortuna_method(void) diff --git a/lib/hcrypto/rand-timer.c b/lib/hcrypto/rand-timer.c index dd3b542a8..e3fd5d524 100644 --- a/lib/hcrypto/rand-timer.c +++ b/lib/hcrypto/rand-timer.c @@ -183,6 +183,16 @@ timer_status(void) #endif } +#if defined(__GUNC__) || (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, @@ -191,6 +201,7 @@ const RAND_METHOD hc_rand_timer_method = { timer_pseudorand, timer_status }; +#endif const RAND_METHOD * RAND_timer_method(void)