Skip to content

Commit e6ab5d9

Browse files
committed
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
1 parent e3b77d6 commit e6ab5d9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

parser/expat/lib/xmlparse.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,13 @@ gather_time_entropy(void)
818818
# include <bsd/stdlib.h>
819819
#endif
820820

821+
/* BEGIN MOZILLA CHANGE (not all Android NDK versions have the function
822+
* declaration, although the function has been available in bionic forever) */
823+
#if defined(HAVE_ARC4RANDOM_BUF) && defined(__ANDROID__)
824+
__attribute__((visibility("default"))) void arc4random_buf(void*, size_t);
825+
#endif
826+
/* END MOZILLA CHANGE */
827+
821828
static unsigned long
822829
ENTROPY_DEBUG(const char * label, unsigned long entropy) {
823830
/* BEGIN MOZILLA CHANGE (don't getenv every time we set up a hash) */

0 commit comments

Comments
 (0)