Commit 22bbd78e authored by Mike Hommey's avatar Mike Hommey Committed by Georg Koppen
Browse files

Bug 1516642 - Add a function declaration for arc4random_buf in expat. r=peterv

The function has been in bionic (Android's libc since the first commit
in the upstream repository), but it's not been in stdlib.h until
recently. As it happens, we have a similar declaration in
xpcom/base/nsUUIDGenerator.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D19120

--HG--
extra : moz-landing-system : lando
parent 00a7fc74
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -818,6 +818,13 @@ gather_time_entropy(void)
# include <bsd/stdlib.h>
#endif

/* BEGIN MOZILLA CHANGE (not all Android NDK versions have the function
 * declaration, although the function has been available in bionic forever) */
#if defined(HAVE_ARC4RANDOM_BUF) && defined(__ANDROID__)
__attribute__((visibility("default"))) void arc4random_buf(void*, size_t);
#endif
/* END MOZILLA CHANGE */

static unsigned long
ENTROPY_DEBUG(const char * label, unsigned long entropy) {
/* BEGIN MOZILLA CHANGE (don't getenv every time we set up a hash) */