From a03390a8b0318e30ae3b6dc9954093c137a20c32 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 4 Mar 2017 09:33:35 -0800 Subject: Detect the (stated) C++ standard edition at build time The configure-time detection (cxx11default) isn't enough if the compiler can be changed. This is especially necessary if Qt is compiled with a compiler that defaults to >= C++11 (e.g., GCC 6) and then the user selects a compiler another compiler (e.g., Clang) via -spec option. In that case, we'd miss adding the -std=c++11 or -std=gnu++11 option to the command-line, causing the compilation to fail. As a nice side-effect, even moc without moc_predefs.h will now get the __cplusplus setting. Task-number: QTBUG-58321 Change-Id: I74966ed02f674a7295f8fffd14a8be35da9640e1 Reviewed-by: Oswald Buddenhagen Reviewed-by: Marc Mutz --- config.tests/common/c++98default/c++98default.cpp | 44 ----------------------- config.tests/common/c++98default/c++98default.pro | 3 -- 2 files changed, 47 deletions(-) delete mode 100644 config.tests/common/c++98default/c++98default.cpp delete mode 100644 config.tests/common/c++98default/c++98default.pro (limited to 'config.tests') diff --git a/config.tests/common/c++98default/c++98default.cpp b/config.tests/common/c++98default/c++98default.cpp deleted file mode 100644 index 3ff92eda33..0000000000 --- a/config.tests/common/c++98default/c++98default.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** 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-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if __cplusplus < 201103L -#error "compiler does not use c++11 or higher by default" -#endif - -int main(int, char **) {} diff --git a/config.tests/common/c++98default/c++98default.pro b/config.tests/common/c++98default/c++98default.pro deleted file mode 100644 index 97cf2d7b20..0000000000 --- a/config.tests/common/c++98default/c++98default.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE = app -CONFIG -= c++11 c++14 c++1z -SOURCES = c++98default.cpp -- cgit v1.2.3 From 3096e0fbd9feff8cbf09b8d0b02fffb48e423eac Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 23 Mar 2017 10:59:58 +0200 Subject: qnx: make alloca config test pass on QNX 7 Test failed on QNX 7, even though alloca is available. On QNX7, it's a macro that expands to a line with NULL, but without define for it. alloca.cpp:44:5: error: 'NULL' was not declared in this scope Task-number: QTBUG-59700 Change-Id: I3631d139990020a3adbab8b72e49929b6e721e80 Reviewed-by: Lars Knoll --- config.tests/common/alloca/alloca.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config.tests') diff --git a/config.tests/common/alloca/alloca.cpp b/config.tests/common/alloca/alloca.cpp index 566ee5651a..d839b381ef 100644 --- a/config.tests/common/alloca/alloca.cpp +++ b/config.tests/common/alloca/alloca.cpp @@ -39,6 +39,9 @@ #include +// extra include needed in QNX7 to define NULL for the alloca() macro +#include + int main(int, char **) { alloca(1); -- cgit v1.2.3 From c817b33b45f2886c89d8a768c61ffffaa46f67a4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 3 Apr 2017 15:41:44 -0700 Subject: f16c: Use the packed intrinsics instead of scalar ones MSVC, Apple's Clang and Clang prior to 3.9 do not recognize _cvtss_sh and _cvtsh_ss. So expand the operation to use directly the packed intrinsics. Change-Id: I27b55fdf514247549455fffd14b2046fd638593d Reviewed-by: Allan Sandfeld Jensen --- config.tests/common/f16c/f16c.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'config.tests') diff --git a/config.tests/common/f16c/f16c.cpp b/config.tests/common/f16c/f16c.cpp index fc73e4fc55..aeeb35eac3 100644 --- a/config.tests/common/f16c/f16c.cpp +++ b/config.tests/common/f16c/f16c.cpp @@ -41,14 +41,11 @@ int main(int, char**) { - float f = 1.f; - unsigned short s = _cvtss_sh(f, 0); - float g = _cvtsh_ss(s); - bool result = f == g; - (void)result; __m128i a = _mm_setzero_si128(); - __m256 b = _mm256_cvtph_ps(a); - __m128i c = _mm256_cvtps_ph(b, 0); + __m128 b = _mm_cvtph_ps(a); + __m256 b256 = _mm256_cvtph_ps(a); + __m128i c = _mm_cvtps_ph(b, 0); + c = _mm256_cvtps_ph(b256, 0); (void)c; return 0; } -- cgit v1.2.3