Properly guard rand_r use with _POSIX_THREAD_SAFE_FUNCTIONS for Android.
Android does not support this, or other thread-safe functions. Change-Id: Id2a918f83e6138795196c45f89613c5b46911901 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This commit is contained in:
parent
ee69c935c0
commit
1cf82c4081
@ -2168,7 +2168,7 @@ void qsrand(uint seed)
|
||||
*/
|
||||
int qrand()
|
||||
{
|
||||
#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD)
|
||||
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
|
||||
SeedStorage *seedStorage = randTLS();
|
||||
if (seedStorage) {
|
||||
SeedStorageType *pseed = seedStorage->localData();
|
||||
|
Loading…
Reference in New Issue
Block a user