diff options
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qatomic.cpp | 26 | ||||
-rw-r--r-- | src/corelib/thread/qatomic_msvc.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qbasicatomic.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qthread.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/thread/qwaitcondition_unix.cpp | 2 |
6 files changed, 20 insertions, 20 deletions
diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp index 5c3ad9412f..d302da72eb 100644 --- a/src/corelib/thread/qatomic.cpp +++ b/src/corelib/thread/qatomic.cpp @@ -1750,33 +1750,33 @@ QT_BEGIN_NAMESPACE // The following specializations must always be defined -Q_STATIC_ASSERT(sizeof(QAtomicInteger<unsigned>)); -Q_STATIC_ASSERT(sizeof(QAtomicInteger<long>)); -Q_STATIC_ASSERT(sizeof(QAtomicInteger<unsigned long>)); -Q_STATIC_ASSERT(sizeof(QAtomicInteger<quintptr>)); -Q_STATIC_ASSERT(sizeof(QAtomicInteger<qptrdiff>)); +static_assert(sizeof(QAtomicInteger<unsigned>)); +static_assert(sizeof(QAtomicInteger<long>)); +static_assert(sizeof(QAtomicInteger<unsigned long>)); +static_assert(sizeof(QAtomicInteger<quintptr>)); +static_assert(sizeof(QAtomicInteger<qptrdiff>)); #ifdef Q_COMPILER_UNICODE_STRINGS -Q_STATIC_ASSERT(sizeof(QAtomicInteger<char32_t>)); +static_assert(sizeof(QAtomicInteger<char32_t>)); #endif #ifdef Q_ATOMIC_INT16_IS_SUPPORTED -Q_STATIC_ASSERT(sizeof(QAtomicInteger<short>)); -Q_STATIC_ASSERT(sizeof(QAtomicInteger<unsigned short>)); +static_assert(sizeof(QAtomicInteger<short>)); +static_assert(sizeof(QAtomicInteger<unsigned short>)); # if WCHAR_MAX < 0x10000 -Q_STATIC_ASSERT(sizeof(QAtomicInteger<wchar_t>)); +static_assert(sizeof(QAtomicInteger<wchar_t>)); # endif # ifdef Q_COMPILER_UNICODE_STRINGS -Q_STATIC_ASSERT(sizeof(QAtomicInteger<char16_t>)); +static_assert(sizeof(QAtomicInteger<char16_t>)); # endif #endif #ifdef Q_ATOMIC_INT64_IS_SUPPORTED -Q_STATIC_ASSERT(sizeof(QAtomicInteger<qint64>)); -Q_STATIC_ASSERT(sizeof(QAtomicInteger<quint64>)); +static_assert(sizeof(QAtomicInteger<qint64>)); +static_assert(sizeof(QAtomicInteger<quint64>)); #endif #if WCHAR_MAX == INT_MAX -Q_STATIC_ASSERT(sizeof(QAtomicInteger<wchar_t>)); +static_assert(sizeof(QAtomicInteger<wchar_t>)); #endif QT_END_NAMESPACE diff --git a/src/corelib/thread/qatomic_msvc.h b/src/corelib/thread/qatomic_msvc.h index 67b5224cd7..54b12f5bb2 100644 --- a/src/corelib/thread/qatomic_msvc.h +++ b/src/corelib/thread/qatomic_msvc.h @@ -291,9 +291,9 @@ template <int N> struct QAtomicOpsBySize : QGenericAtomicOps<QAtomicOpsBySize<N> private: typedef typename QAtomicWindowsType<N>::Type Type; template <typename T> static inline Type *atomic(T *t) - { Q_STATIC_ASSERT(sizeof(T) == sizeof(Type)); return reinterpret_cast<Type *>(t); } + { static_assert(sizeof(T) == sizeof(Type)); return reinterpret_cast<Type *>(t); } template <typename T> static inline Type value(T t) - { Q_STATIC_ASSERT(sizeof(T) == sizeof(Type)); return Type(t); } + { static_assert(sizeof(T) == sizeof(Type)); return Type(t); } }; template <typename T> diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index c9c95cf6ce..18da268270 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -93,8 +93,8 @@ public: typedef T Type; typedef QAtomicOps<T> Ops; // static check that this is a valid integer - Q_STATIC_ASSERT_X(QTypeInfo<T>::isIntegral, "template parameter is not an integral type"); - Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); + static_assert(QTypeInfo<T>::isIntegral, "template parameter is not an integral type"); + static_assert(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); typename Ops::Type _q_value; diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h index 635dd94522..5a1e63ee0a 100644 --- a/src/corelib/thread/qthread.h +++ b/src/corelib/thread/qthread.h @@ -253,7 +253,7 @@ QThread *QThread::create(Function &&f) inline Qt::HANDLE QThread::currentThreadId() noexcept { Qt::HANDLE tid; // typedef to void* - Q_STATIC_ASSERT(sizeof(tid) == sizeof(void*)); + static_assert(sizeof(tid) == sizeof(void*)); // See https://akkadia.org/drepper/tls.pdf for x86 ABI #if defined(Q_PROCESSOR_X86_32) && defined(Q_OS_LINUX) // x86 32-bit always uses GS __asm__("movl %%gs:0, %0" : "=r" (tid) : : ); diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 96c3f5c45c..35bfd35f1a 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -104,7 +104,7 @@ QT_BEGIN_NAMESPACE #if QT_CONFIG(thread) -Q_STATIC_ASSERT(sizeof(pthread_t) <= sizeof(Qt::HANDLE)); +static_assert(sizeof(pthread_t) <= sizeof(Qt::HANDLE)); enum { ThreadPriorityResetFlag = 0x80000000 }; diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp index 88b058f410..a1c973562b 100644 --- a/src/corelib/thread/qwaitcondition_unix.cpp +++ b/src/corelib/thread/qwaitcondition_unix.cpp @@ -108,7 +108,7 @@ void qt_abstime_for_timeout(timespec *ts, QDeadlineTimer deadline) normalizedTimespec(*ts); #else // depends on QDeadlineTimer's internals!! - Q_STATIC_ASSERT(QDeadlineTimerNanosecondsInT2); + static_assert(QDeadlineTimerNanosecondsInT2); ts->tv_sec = deadline._q_data().first; ts->tv_nsec = deadline._q_data().second; #endif |