SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,24 @@
--- src/port.h.orig Sun Aug 11 22:56:24 2013
+++ src/port.h Sun Aug 11 23:00:53 2013
@@ -246,7 +246,11 @@ extern char *sys_errlist[];
* not agree with RAND_MAX. We must not link with -lucb.
*/
-#ifdef HAVE_srandom
+#if defined(HAVE_arc4random) && defined(HAVE_arc4random_uniform)
+# define RAND() arc4random()
+# define SRAND(seed) /* empty */
+# define RRAND(lo,hi) (arc4random_uniform((hi)-(lo)) + (lo))
+#elif defined(HAVE_srandom)
# include <math.h>
# define RAND() (int)random()
# define SRAND(seed) srandom(seed)
@@ -262,7 +266,7 @@ extern char *sys_errlist[];
# define RRAND(lo,hi) (RAND() % ((hi)-(lo)+1) + (lo))
# endif
# else
- error "Don't have srand() or srandom()."
+# error "Don't have srand() or srandom()."
# endif
#endif