From 769722778120623e2a873a14e3db2e5e53098fce Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 13 Apr 2017 18:59:59 -0700 Subject: Use QtPrivate::FunctionPointer to get the type of srand's first arg Avoids #ifdefs and guesswork. Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5210efaea7d00 Reviewed-by: Lars Knoll --- src/corelib/global/qrandom.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/corelib/global/qrandom.cpp') diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 573e762fc9..99a91c2221 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -42,6 +42,7 @@ #include "qrandom.h" #include "qrandom_p.h" +#include #include #if QT_HAS_INCLUDE() @@ -730,13 +731,7 @@ void QRandomGenerator::fillRange_helper(void *buffer, void *bufferEnd) } #if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0) - -# if defined(Q_OS_INTEGRITY) && defined(__GHS_VERSION_NUMBER) && (__GHS_VERSION_NUMBER < 500) -// older versions of INTEGRITY used a long instead of a uint for the seed. -typedef long SeedStorageType; -# else -typedef uint SeedStorageType; -# endif +using SeedStorageType = QtPrivate::FunctionPointer::Arguments::Car; typedef QThreadStorage SeedStorage; Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value -- cgit v1.2.3