michael@0: --- a/evutil_rand.c 2012-08-02 10:36:53.000000000 -0500 michael@0: +++ b/evutil_rand.c 2013-02-20 13:01:45.000000000 -0600 michael@0: @@ -58,27 +58,16 @@ evutil_secure_rng_global_setup_locks_(co michael@0: static void michael@0: ev_arc4random_buf(void *buf, size_t n) michael@0: { michael@0: #if defined(_EVENT_HAVE_ARC4RANDOM_BUF) && !defined(__APPLE__) michael@0: return arc4random_buf(buf, n); michael@0: #else michael@0: unsigned char *b = buf; michael@0: michael@0: -#if defined(_EVENT_HAVE_ARC4RANDOM_BUF) michael@0: - /* OSX 10.7 introducd arc4random_buf, so if you build your program michael@0: - * there, you'll get surprised when older versions of OSX fail to run. michael@0: - * To solve this, we can check whether the function pointer is set, michael@0: - * and fall back otherwise. (OSX does this using some linker michael@0: - * trickery.) michael@0: - */ michael@0: - if (arc4random_buf != NULL) { michael@0: - return arc4random_buf(buf, n); michael@0: - } michael@0: -#endif michael@0: /* Make sure that we start out with b at a 4-byte alignment; plenty michael@0: * of CPUs care about this for 32-bit access. */ michael@0: if (n >= 4 && ((ev_uintptr_t)b) & 3) { michael@0: ev_uint32_t u = arc4random(); michael@0: int n_bytes = 4 - (((ev_uintptr_t)b) & 3); michael@0: memcpy(b, &u, n_bytes); michael@0: b += n_bytes; michael@0: n -= n_bytes;