aboutsummaryrefslogtreecommitdiff
path: root/util/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/random.c')
-rw-r--r--util/random.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/random.c b/util/random.c
index bb564f2f99aa..6eb102c634b9 100644
--- a/util/random.c
+++ b/util/random.c
@@ -78,7 +78,7 @@
*/
#define MAX_VALUE 0x7fffffff
-#if defined(HAVE_SSL)
+#if defined(HAVE_SSL) || defined(HAVE_LIBBSD)
struct ub_randstate*
ub_initstate(struct ub_randstate* ATTR_UNUSED(from))
{
@@ -183,10 +183,10 @@ long int ub_random(struct ub_randstate* s)
}
return x & MAX_VALUE;
}
-#endif /* HAVE_SSL or HAVE_NSS or HAVE_NETTLE */
+#endif /* HAVE_SSL or HAVE_LIBBSD or HAVE_NSS or HAVE_NETTLE */
-#if defined(HAVE_NSS) || defined(HAVE_NETTLE)
+#if defined(HAVE_NSS) || defined(HAVE_NETTLE) && !defined(HAVE_LIBBSD)
long int
ub_random_max(struct ub_randstate* state, long int x)
{
@@ -198,7 +198,7 @@ ub_random_max(struct ub_randstate* state, long int x)
v = ub_random(state);
return (v % x);
}
-#endif /* HAVE_NSS or HAVE_NETTLE */
+#endif /* HAVE_NSS or HAVE_NETTLE and !HAVE_LIBBSD */
void
ub_randfree(struct ub_randstate* s)