diff options
Diffstat (limited to 'tests/auto/corelib/global/qglobal/qglobal.c')
-rw-r--r-- | tests/auto/corelib/global/qglobal/qglobal.c | 67 |
1 files changed, 30 insertions, 37 deletions
diff --git a/tests/auto/corelib/global/qglobal/qglobal.c b/tests/auto/corelib/global/qglobal/qglobal.c index b577a6f71f..2cfbd5e3be 100644 --- a/tests/auto/corelib/global/qglobal/qglobal.c +++ b/tests/auto/corelib/global/qglobal/qglobal.c @@ -1,41 +1,10 @@ -/**************************************************************************** -** -** Copyright (C) 2017 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 Intel Corporation. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/qglobal.h> - -#if __has_include(<stdbool.h>) || __STDC_VERSION__ >= 199901L -# include <stdbool.h> -#else -# undef true -# define true 1 -# undef false -# define false 0 -#endif +#include <QtCore/qtversion.h> +#include <QtCore/qyieldcpu.h> +#include <QtCore/qtypes.h> #ifdef Q_COMPILER_THREAD_LOCAL # include <threads.h> @@ -46,6 +15,11 @@ * everything works. */ +#if defined(Q_OS_VXWORKS) && !defined(thread_local) +// threads.h forgot to define this (should be fixed for version 23.11) +# define thread_local _Thread_local +#endif + /* Types and Q_UNUSED */ void tst_GlobalTypes() { @@ -77,15 +51,28 @@ void tst_GlobalTypes() qintptr qip; quintptr qup; Q_UNUSED(qs); Q_UNUSED(qp); Q_UNUSED(qip); Q_UNUSED(qup); + +#ifdef QT_SUPPORTS_INT128 + qint128 s128; + quint128 u128; + Q_UNUSED(s128); Q_UNUSED(u128); +#endif /* QT_SUPPORTS_INT128 */ } +#if QT_SUPPORTS_INT128 +qint128 tst_qint128_min() { return Q_INT128_MIN + 0; } +qint128 tst_qint128_max() { return 0 + Q_INT128_MAX; } +quint128 tst_quint128_max() { return Q_UINT128_MAX - 1 + 1; } +#endif + /* Qt version */ int tst_QtVersion() { return QT_VERSION; } -const char *tst_qVersion() Q_DECL_NOEXCEPT +const char *tst_qVersion() Q_DECL_NOEXCEPT; +const char *tst_qVersion() { #if !defined(QT_NAMESPACE) return qVersion(); @@ -94,6 +81,12 @@ const char *tst_qVersion() Q_DECL_NOEXCEPT #endif } +void tst_qYieldCpu(void) Q_DECL_NOEXCEPT; +void tst_qYieldCpu(void) +{ + qYieldCpu(); +} + /* Static assertion */ Q_STATIC_ASSERT(true); Q_STATIC_ASSERT(1); |