diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-04-01 23:59:55 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2021-04-07 08:36:03 -0700 |
commit | 89a0ed100977a86f12ce0837b4d7787b88f09922 (patch) | |
tree | 1930deadf5d081a0e84cb982c49b59cce4f9de3d /src/corelib/global/qrandom.cpp | |
parent | 30d5e13768d970e538737d1740898f59157e6017 (diff) |
Allow qrandom_p.h to be included by more than one .cpp in QtCore
I thought we could use C++17 inline variables, but those can't be used
across DLL boundaries:
qrandom_p.h:75:48: error: definition of 'QBasicAtomicInteger<unsigned int> qt_randomdevice_control' is marked 'dllimport'
Change-Id: Id2983978ad544ff79911fffd1671f857587ef2fb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/corelib/global/qrandom.cpp')
-rw-r--r-- | src/corelib/global/qrandom.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 6db8121028..c978228094 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -92,6 +92,10 @@ enum { FillBufferNoexcept = true }; +#if defined(QT_BUILD_INTERNAL) +QBasicAtomicInteger<uint> qt_randomdevice_control = Q_BASIC_ATOMIC_INITIALIZER(0U); +#endif + struct QRandomGenerator::SystemGenerator { #if QT_CONFIG(getentropy) |