summaryrefslogtreecommitdiff
path: root/defines.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-11-07 13:28:16 +1100
committerDamien Miller <djm@mindrot.org>2013-11-07 13:28:16 +1100
commitdf8b030b15fcec7baf38ec7944f309f9ca8cc9a7 (patch)
tree70ae8223d81ef4a7692be0eb295ad5cf1b98aee7 /defines.h
parenta6fd1d3c38a562709374a70fa76423859160aa90 (diff)
- (djm) [configure.ac defines.h] Skip arc4random_stir() calls on platforms
that lack it but have arc4random_uniform()
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/defines.h b/defines.h
index f4b262c8..b014f349 100644
--- a/defines.h
+++ b/defines.h
@@ -25,7 +25,7 @@
#ifndef _DEFINES_H
#define _DEFINES_H
-/* $Id: defines.h,v 1.173 2013/11/03 07:43:55 dtucker Exp $ */
+/* $Id: defines.h,v 1.174 2013/11/07 02:28:16 djm Exp $ */
/* Constants */
@@ -810,4 +810,13 @@ struct winsize {
# endif
#endif
+/*
+ * Platforms that have arc4random_uniform() and not arc4random_stir()
+ * shouldn't need the latter.
+ */
+#if defined(HAVE_ARC4RANDOM) && defined(HAVE_ARC4RANDOM_UNIFORM) && \
+ !defined(HAVE_ARC4RANDOM_STIR)
+# define arc4random_stir()
+#endif
+
#endif /* _DEFINES_H */