Fix compilation for embedded Android

Change-Id: If42fd83a68543d59b5a3a6b89e2c402aa452b251
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
aavit 2013-11-11 11:04:16 +01:00 committed by The Qt Project
parent bf246e6c28
commit 0a1cb466df

View File

@ -76,7 +76,7 @@
#include <CoreServices/CoreServices.h>
#endif
#if defined(Q_OS_ANDROID)
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
#include <private/qjni_p.h>
#endif
@ -2387,7 +2387,7 @@ typedef uint SeedStorageType;
typedef QThreadStorage<SeedStorageType *> SeedStorage;
Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
#elif defined(Q_OS_ANDROID)
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
typedef QThreadStorage<QJNIObjectPrivate> AndroidRandomStorage;
Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
#endif
@ -2423,7 +2423,7 @@ void qsrand(uint seed)
//global static object, fallback to srand(seed)
srand(seed);
}
#elif defined(Q_OS_ANDROID)
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
if (randomTLS->hasLocalData()) {
randomTLS->localData().callMethod<void>("setSeed", "(J)V", jlong(seed));
return;
@ -2479,7 +2479,7 @@ int qrand()
//global static object, fallback to rand()
return rand();
}
#elif defined(Q_OS_ANDROID)
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
AndroidRandomStorage *randomStorage = randomTLS();
if (!randomStorage)
return rand();