Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:07:24

0001 // Copyright (C) 2011 Thiago Macieira <thiago@kde.org>
0002 // Copyright (C) 2016 Intel Corporation.
0003 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0004 
0005 #ifndef QGENERICATOMIC_H
0006 #define QGENERICATOMIC_H
0007 
0008 #include <QtCore/qcompilerdetection.h>
0009 #include <QtCore/qtconfigmacros.h>
0010 #include <QtCore/qtypes.h>
0011 
0012 QT_BEGIN_NAMESPACE
0013 
0014 #if 0
0015 // silence syncqt warnings
0016 QT_END_NAMESPACE
0017 #pragma qt_sync_skip_header_check
0018 #pragma qt_sync_stop_processing
0019 #endif
0020 
0021 template<int Size> struct QAtomicOpsSupport
0022 {
0023     enum { IsSupported = (Size == sizeof(int) || Size == sizeof(qptrdiff)) };
0024 };
0025 
0026 template <typename T> struct QAtomicAdditiveType
0027 {
0028     typedef T AdditiveT;
0029     static const int AddScale = 1;
0030 };
0031 template <typename T> struct QAtomicAdditiveType<T *>
0032 {
0033     typedef qptrdiff AdditiveT;
0034     static const int AddScale = sizeof(T);
0035 };
0036 
0037 QT_END_NAMESPACE
0038 #endif // QGENERICATOMIC_H