diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-02-18 17:40:57 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-02-19 13:40:13 -0800 |
commit | ff63a38bb82849eb3eb13f7aae99fa2fa5d71e2d (patch) | |
tree | 2af3b7102a68b30431e568001d256c57bdfa44d9 /src/corelib/global | |
parent | ec39010390d121c11be6135a5157515da0b708ef (diff) |
qsimd_p.h: group the two HWRNG-related functions
Change-Id: Ic15405335d804bdea761fffd16d50c62ebdf6c0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qsimd_p.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/corelib/global/qsimd_p.h b/src/corelib/global/qsimd_p.h index 8d3a63de7b..ad769ee7a6 100644 --- a/src/corelib/global/qsimd_p.h +++ b/src/corelib/global/qsimd_p.h @@ -398,14 +398,23 @@ static inline quint64 qCpuFeatures() #define qCpuHasFeature(feature) (((qCompilerCpuFeatures & CpuFeature ## feature) == CpuFeature ## feature) \ || ((qCpuFeatures() & CpuFeature ## feature) == CpuFeature ## feature)) -inline bool qHasHwrng() +# if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND) && !defined(QT_BOOTSTRAPPED) +Q_CORE_EXPORT qsizetype qRandomCpu(void *, qsizetype) noexcept; + +static inline bool qHasHwrng() { -#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND) return qCpuHasFeature(RDRND); -#else +} +# else +static inline qsizetype qRandomCpu(void *, qsizetype) noexcept +{ + return 0; +} +static inline bool qHasHwrng() +{ return false; -#endif } +# endif QT_END_NAMESPACE |