Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgenericatomic.h
Go to the documentation of this file.
1// Copyright (C) 2011 Thiago Macieira <thiago@kde.org>
2// Copyright (C) 2016 Intel Corporation.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QGENERICATOMIC_H
7#define QGENERICATOMIC_H
8
9#include <QtCore/qcompilerdetection.h>
10#include <QtCore/qtconfigmacros.h>
11#include <QtCore/qtypes.h>
12
13QT_BEGIN_NAMESPACE
14
15#if 0
16// silence syncqt warnings
17QT_END_NAMESPACE
18#pragma qt_sync_skip_header_check
19#pragma qt_sync_stop_processing
20#endif
21
22template<int Size> struct QAtomicOpsSupport
23{
24 enum { IsSupported = (Size == sizeof(int) || Size == sizeof(qptrdiff)) };
25};
26
27template <typename T> struct QAtomicAdditiveType
28{
29 typedef T AdditiveT;
30 static const int AddScale = 1;
31};
32template <typename T> struct QAtomicAdditiveType<T *>
33{
35 static const int AddScale = sizeof(T);
36};
37
38QT_END_NAMESPACE
39#endif // QGENERICATOMIC_H
static const int AddScale