commit 8de1662514e5191715055479b503dbb016899e84 Author: Mike Hommey mh+mozilla@glandium.org Date: Fri Feb 8 13:48:36 2019 +0000
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 --- parser/expat/lib/xmlparse.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/parser/expat/lib/xmlparse.c b/parser/expat/lib/xmlparse.c index 209f20e094dc..12a7fc232e5f 100644 --- a/parser/expat/lib/xmlparse.c +++ b/parser/expat/lib/xmlparse.c @@ -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) */