1// Copyright (C) 2017 Intel Corporation.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QRANDOM_P_H
5#define QRANDOM_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qglobal_p.h"
19#include <qrandom.h>
20#include <private/qsimd_p.h>
21
22QT_BEGIN_NAMESPACE
23
24enum QRandomGeneratorControl {
25 UseSystemRNG = 1,
26 SkipSystemRNG = 2,
27 SkipHWRNG = 4,
28 SetRandomData = 8,
29
30 // 28 bits
31 RandomDataMask = 0xfffffff0
32};
33
34enum RNGType {
35 SystemRNG = 0,
36 MersenneTwister = 1
37};
38
39#if defined(QT_BUILD_INTERNAL)
40extern Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control;
41#else
42static const struct
43{
44 uint loadAcquire() const { return 0; }
45} qt_randomdevice_control;
46#endif
47
48QRandomGenerator::InitialRandomData qt_initial_random_value() noexcept;
49
50QT_END_NAMESPACE
51
52#endif // QRANDOM_P_H
53

source code of qtbase/src/corelib/global/qrandom_p.h