summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qrandom_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-06-26 07:56:49 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-06-28 00:24:10 +0200
commit5220b40edd52ea70ed3a09f9a28fa7fe50ce71e6 (patch)
tree4bdd731901e9352ea302fafd2f6413cb84ec9750 /src/corelib/global/qrandom_p.h
parente36e32c21312eee42194815da82203648023a67b (diff)
Port from implicit to explicit atomic integer operations
The old code used the implicit conversions from QAtomicInteger<T> to T and vice versa. The semantics of these differ from the ones std::atomic uses, so we're going to deprecate these, like we did for load() and store(), too. This patch fixex some users of these APIs before we deprecate them. Change-Id: I4877276581757cd57e042efea8296fe535a493d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qrandom_p.h')
-rw-r--r--src/corelib/global/qrandom_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/global/qrandom_p.h b/src/corelib/global/qrandom_p.h
index 917a91098e..167f4cc57d 100644
--- a/src/corelib/global/qrandom_p.h
+++ b/src/corelib/global/qrandom_p.h
@@ -76,7 +76,9 @@ Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control = Q_BASIC_ATOMIC
#elif defined(QT_BUILD_INTERNAL)
extern Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control;
#else
-enum { qt_randomdevice_control = 0 };
+static const struct {
+ uint loadAcquire() const { return 0; }
+} qt_randomdevice_control;
#endif
inline bool qt_has_hwrng()