Make HAVE_DECL_ARC4RANDOM always defined. Sort the entry correctly.
llvm-svn: 282768
This commit is contained in:
parent
5c50539503
commit
8472f847ca
|
@ -16,9 +16,6 @@
|
|||
/* Define if position independent code is enabled */
|
||||
#cmakedefine ENABLE_PIC
|
||||
|
||||
/* Define to 1 if you have the `arc4random' function. */
|
||||
#cmakedefine HAVE_DECL_ARC4RANDOM ${HAVE_DECL_ARC4RANDOM}
|
||||
|
||||
/* Define to 1 if you have the `backtrace' function. */
|
||||
#cmakedefine HAVE_BACKTRACE ${HAVE_BACKTRACE}
|
||||
|
||||
|
@ -34,6 +31,10 @@
|
|||
/* can use __crashreporter_info__ */
|
||||
#undef HAVE_CRASHREPORTER_INFO
|
||||
|
||||
/* Define to 1 if you have the declaration of `arc4random', and to 0 if you
|
||||
don't. */
|
||||
#cmakedefine01 HAVE_DECL_ARC4RANDOM
|
||||
|
||||
/* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you
|
||||
don't. */
|
||||
#cmakedefine01 HAVE_DECL_FE_ALL_EXCEPT
|
||||
|
|
|
@ -429,7 +429,7 @@ const char *Process::ResetColor() {
|
|||
return "\033[0m";
|
||||
}
|
||||
|
||||
#if !defined(HAVE_DECL_ARC4RANDOM) || !HAVE_DECL_ARC4RANDOM
|
||||
#if !HAVE_DECL_ARC4RANDOM
|
||||
static unsigned GetRandomNumberSeed() {
|
||||
// Attempt to get the initial seed from /dev/urandom, if possible.
|
||||
int urandomFD = open("/dev/urandom", O_RDONLY);
|
||||
|
@ -455,7 +455,7 @@ static unsigned GetRandomNumberSeed() {
|
|||
#endif
|
||||
|
||||
unsigned llvm::sys::Process::GetRandomNumber() {
|
||||
#if defined(HAVE_DECL_ARC4RANDOM) && HAVE_DECL_ARC4RANDOM
|
||||
#if HAVE_DECL_ARC4RANDOM
|
||||
return arc4random();
|
||||
#else
|
||||
static int x = (static_cast<void>(::srand(GetRandomNumberSeed())), 0);
|
||||
|
|
Loading…
Reference in New Issue