mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-06 17:25:24 +08:00
qt 6.6.0 clean
This commit is contained in:
10565
src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp
vendored
Normal file
10565
src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2632
src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.h
vendored
Normal file
2632
src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
19
src/3rdparty/D3D12MemoryAllocator/LICENSE.txt
vendored
Normal file
19
src/3rdparty/D3D12MemoryAllocator/LICENSE.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
91
src/3rdparty/D3D12MemoryAllocator/patches/0001-Eliminate-warnings-in-D3D12MA.patch
vendored
Normal file
91
src/3rdparty/D3D12MemoryAllocator/patches/0001-Eliminate-warnings-in-D3D12MA.patch
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
From d83bc556c26b13e1a243c71628f75ef624de05bf Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Agocs <laszlo.agocs@qt.io>
|
||||
Date: Sat, 21 Jan 2023 20:07:00 +0100
|
||||
Subject: [PATCH] Eliminate warnings in D3D12MA
|
||||
|
||||
Change-Id: If703c50cc1239248b94967edb4047868aaf07f1a
|
||||
---
|
||||
.../D3D12MemoryAllocator/D3D12MemAlloc.cpp | 23 ++++++++++++++++++-
|
||||
.../D3D12MemoryAllocator/D3D12MemAlloc.h | 6 ++---
|
||||
2 files changed, 25 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp b/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp
|
||||
index fe1856927f..f041ec13d8 100644
|
||||
--- a/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp
|
||||
+++ b/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.cpp
|
||||
@@ -132,6 +132,18 @@ especially to test compatibility with D3D12_RESOURCE_HEAP_TIER_1 on modern GPUs.
|
||||
#define D3D12MA_CREATE_NOT_ZEROED_AVAILABLE 1
|
||||
#endif
|
||||
|
||||
+#if defined(__clang__) || defined(__GNUC__)
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
+#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
+#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
+#pragma GCC diagnostic ignored "-Wswitch"
|
||||
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
+#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
+#pragma GCC diagnostic ignored "-Wnonnull-compare"
|
||||
+#endif
|
||||
+
|
||||
namespace D3D12MA
|
||||
{
|
||||
static constexpr UINT HEAP_TYPE_COUNT = 4;
|
||||
@@ -7581,12 +7593,14 @@ void AllocatorPimpl::BuildStatsString(WCHAR** ppStatsString, BOOL detailedMap)
|
||||
json.WriteString(L"HEAP_FLAG_ALLOW_DISPLAY");
|
||||
if (flags & D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER)
|
||||
json.WriteString(L"HEAP_FLAG_CROSS_ADAPTER");
|
||||
+#ifdef __ID3D12Device8_INTERFACE_DEFINED__
|
||||
if (flags & D3D12_HEAP_FLAG_HARDWARE_PROTECTED)
|
||||
json.WriteString(L"HEAP_FLAG_HARDWARE_PROTECTED");
|
||||
if (flags & D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH)
|
||||
json.WriteString(L"HEAP_FLAG_ALLOW_WRITE_WATCH");
|
||||
if (flags & D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS)
|
||||
json.WriteString(L"HEAP_FLAG_ALLOW_SHADER_ATOMICS");
|
||||
+#endif
|
||||
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
|
||||
if (flags & D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT)
|
||||
json.WriteString(L"HEAP_FLAG_CREATE_NOT_RESIDENT");
|
||||
@@ -7607,9 +7621,12 @@ void AllocatorPimpl::BuildStatsString(WCHAR** ppStatsString, BOOL detailedMap)
|
||||
| D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER
|
||||
| D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES
|
||||
| D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES
|
||||
+#ifdef __ID3D12Device8_INTERFACE_DEFINED__
|
||||
| D3D12_HEAP_FLAG_HARDWARE_PROTECTED
|
||||
| D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH
|
||||
- | D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS);
|
||||
+ | D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS
|
||||
+#endif
|
||||
+ );
|
||||
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
|
||||
flags &= ~(D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT
|
||||
| D3D12_HEAP_FLAG_CREATE_NOT_ZEROED);
|
||||
@@ -10539,3 +10556,7 @@ VirtualBlock::~VirtualBlock()
|
||||
#endif // _D3D12MA_VIRTUAL_BLOCK_FUNCTIONS
|
||||
#endif // _D3D12MA_PUBLIC_INTERFACE
|
||||
} // namespace D3D12MA
|
||||
+
|
||||
+#if defined(__clang__) || defined(__GNUC__)
|
||||
+#pragma GCC diagnostic pop
|
||||
+#endif
|
||||
diff --git a/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.h b/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.h
|
||||
index 4ab7be318e..d80dcb1e89 100644
|
||||
--- a/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.h
|
||||
+++ b/src/3rdparty/D3D12MemoryAllocator/D3D12MemAlloc.h
|
||||
@@ -151,9 +151,9 @@ class D3D12MA_API IUnknownImpl : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual ~IUnknownImpl() = default;
|
||||
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
|
||||
- virtual ULONG STDMETHODCALLTYPE AddRef();
|
||||
- virtual ULONG STDMETHODCALLTYPE Release();
|
||||
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) override;
|
||||
+ ULONG STDMETHODCALLTYPE AddRef() override;
|
||||
+ ULONG STDMETHODCALLTYPE Release() override;
|
||||
protected:
|
||||
virtual void ReleaseThis() { delete this; }
|
||||
private:
|
||||
--
|
||||
2.33.0.windows.2
|
||||
|
16
src/3rdparty/D3D12MemoryAllocator/qt_attribution.json
vendored
Normal file
16
src/3rdparty/D3D12MemoryAllocator/qt_attribution.json
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"Id": "D3D12MemoryAllocator",
|
||||
"Name": "D3D12 Memory Allocator",
|
||||
"QDocModule": "qtgui",
|
||||
"Description": "D3D12 Memory Allocator",
|
||||
"QtUsage": "Memory management for the D3D12 backend of QRhi.",
|
||||
|
||||
"Homepage": "https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator",
|
||||
"Version": "f128d39b7a95b4235bd228d231646278dc6c24b2",
|
||||
"License": "MIT License",
|
||||
"LicenseId": "MIT",
|
||||
"LicenseFile": "LICENSE.txt",
|
||||
"Copyright": "Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved."
|
||||
}
|
||||
]
|
6
src/3rdparty/gradle/gradle.properties
vendored
6
src/3rdparty/gradle/gradle.properties
vendored
@ -3,7 +3,7 @@
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2500m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
org.gradle.jvmargs=-Xmx2500m -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
|
||||
# Enable building projects in parallel
|
||||
org.gradle.parallel=true
|
||||
@ -12,3 +12,7 @@ org.gradle.parallel=true
|
||||
# build with the same inputs. However, over time, the cache size will
|
||||
# grow. Uncomment the following line to enable it.
|
||||
#org.gradle.caching=true
|
||||
#org.gradle.configuration-cache=true
|
||||
|
||||
# Allow AndroidX usage
|
||||
android.useAndroidX=true
|
||||
|
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
31
src/3rdparty/gradle/gradlew
vendored
31
src/3rdparty/gradle/gradlew
vendored
@ -55,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@ -80,13 +80,11 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@ -133,22 +131,29 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@ -193,6 +198,10 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
@ -205,6 +214,12 @@ set -- \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
15
src/3rdparty/gradle/gradlew.bat
vendored
15
src/3rdparty/gradle/gradlew.bat
vendored
@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@ -25,7 +25,8 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
4
src/3rdparty/gradle/qt_attribution.json
vendored
4
src/3rdparty/gradle/qt_attribution.json
vendored
@ -4,8 +4,8 @@
|
||||
"QDocModule": "qtcore",
|
||||
"QtParts": ["tools"],
|
||||
"Homepage": "https://gradle.org",
|
||||
"Version": "8.0",
|
||||
"DownloadLocation": "https://github.com/gradle/gradle/releases/tag/v8.0",
|
||||
"Version": "8.3",
|
||||
"DownloadLocation": "https://github.com/gradle/gradle/releases/tag/v8.3.0",
|
||||
"QtUsage": "Needed to create Android packages",
|
||||
"License": "Apache License 2.0",
|
||||
"LicenseId": "Apache-2.0",
|
||||
|
@ -30,6 +30,7 @@ qt_internal_add_jar(Qt${QtBase_VERSION_MAJOR}Android
|
||||
)
|
||||
|
||||
qt_path_join(destination ${INSTALL_DATADIR} "jar")
|
||||
|
||||
install_jar(Qt${QtBase_VERSION_MAJOR}Android
|
||||
DESTINATION ${destination}
|
||||
COMPONENT Devel
|
||||
|
@ -59,15 +59,15 @@ public class QtMessageDialogHelper
|
||||
}
|
||||
|
||||
|
||||
public void setIcon(int icon)
|
||||
public void setStandardIcon(int icon)
|
||||
{
|
||||
m_icon = icon;
|
||||
m_standardIcon = icon;
|
||||
|
||||
}
|
||||
|
||||
private Drawable getIconDrawable()
|
||||
{
|
||||
if (m_icon == 0)
|
||||
if (m_standardIcon == 0)
|
||||
return null;
|
||||
|
||||
try {
|
||||
@ -80,7 +80,7 @@ public class QtMessageDialogHelper
|
||||
}
|
||||
|
||||
// Information, Warning, Critical, Question
|
||||
switch (m_icon)
|
||||
switch (m_standardIcon)
|
||||
{
|
||||
case 1: // Information
|
||||
try {
|
||||
@ -336,7 +336,7 @@ public class QtMessageDialogHelper
|
||||
|
||||
public void reset()
|
||||
{
|
||||
m_icon = 0;
|
||||
m_standardIcon = 0;
|
||||
m_title = null;
|
||||
m_text = null;
|
||||
m_informativeText = null;
|
||||
@ -347,7 +347,7 @@ public class QtMessageDialogHelper
|
||||
}
|
||||
|
||||
private Activity m_activity;
|
||||
private int m_icon = 0;
|
||||
private int m_standardIcon = 0;
|
||||
private Spanned m_title, m_text, m_informativeText, m_detailedText;
|
||||
private ArrayList<ButtonStruct> m_buttonsList;
|
||||
private AlertDialog m_dialog;
|
||||
|
@ -43,5 +43,15 @@
|
||||
android:name="android.app.extract_android_style"
|
||||
android:value="minimal" />
|
||||
</activity>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.qtprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/qtprovider_paths"/>
|
||||
</provider>
|
||||
</application>
|
||||
</manifest>
|
||||
|
@ -14,6 +14,7 @@ add_custom_target(Qt${QtBase_VERSION_MAJOR}AndroidTemplates
|
||||
SOURCES
|
||||
${template_files}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/res/values/libs.xml"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/res/xml/qtprovider_paths.xml"
|
||||
)
|
||||
|
||||
qt_path_join(destination ${QT_INSTALL_DIR} ${INSTALL_DATADIR} "src/android/templates")
|
||||
|
@ -18,6 +18,7 @@ apply plugin: 'com.android.application'
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
implementation 'androidx.core:core:1.10.1'
|
||||
}
|
||||
|
||||
android {
|
||||
|
4
src/android/templates/res/xml/qtprovider_paths.xml
Normal file
4
src/android/templates/res/xml/qtprovider_paths.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<files-path name="files_path" path="/"/>
|
||||
</paths>
|
@ -8,6 +8,7 @@ qt_internal_add_module(ExampleIconsPrivate
|
||||
)
|
||||
|
||||
set(icons_resource_files
|
||||
index.theme
|
||||
16x16/document-new.png
|
||||
16x16/document-open.png
|
||||
16x16/document-print.png
|
||||
@ -165,7 +166,7 @@ set(icons_resource_files
|
||||
|
||||
qt_internal_add_resource(ExampleIconsPrivate "example_icons"
|
||||
PREFIX
|
||||
"/qt-project.org/examples/icons/"
|
||||
"/qt-project.org/icons/example_icons"
|
||||
FILES
|
||||
${icons_resource_files}
|
||||
)
|
||||
|
@ -17,7 +17,13 @@ Setting up a project for using Example icon library
|
||||
)
|
||||
...
|
||||
|
||||
2. Create image resource in your application code:
|
||||
2. Load the theme
|
||||
...
|
||||
bool success = img->load(":/qt-project.org/examples/icons/32x32/document-new.png");
|
||||
QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << u":/qt-project.org/icons"_s);
|
||||
QIcon::setFallbackThemeName(u"example_icons"_s);
|
||||
...
|
||||
|
||||
3. Use the icons
|
||||
...
|
||||
const QIcon openIcon = QIcon::fromTheme("document-open");
|
||||
...
|
||||
|
46
src/assets/icons/index.theme
Normal file
46
src/assets/icons/index.theme
Normal file
@ -0,0 +1,46 @@
|
||||
[Icon Theme]
|
||||
Name=example_icons
|
||||
|
||||
Directories=16x16,16x16@2,32x32,32x32@2,128x128,128x128@2,256x256,256x256@2,scalable
|
||||
|
||||
[16x16]
|
||||
Size=16
|
||||
Type=Fixed
|
||||
|
||||
[16x16@2]
|
||||
Size=16
|
||||
Scale=2
|
||||
Type=Fixed
|
||||
|
||||
[32x32]
|
||||
Size=32
|
||||
Type=Fixed
|
||||
|
||||
[32x32@2]
|
||||
Size=32
|
||||
Scale=2
|
||||
Type=Fixed
|
||||
|
||||
[128x128]
|
||||
Size=128
|
||||
Type=Fixed
|
||||
|
||||
[128x128@2]
|
||||
Size=128
|
||||
Scale=2
|
||||
Type=Fixed
|
||||
|
||||
[256x256]
|
||||
Size=256
|
||||
Type=Fixed
|
||||
|
||||
[256x256@2]
|
||||
Size=256
|
||||
Scale=2
|
||||
Type=Fixed
|
||||
|
||||
[scalable]
|
||||
Size=512
|
||||
Type=Scalable
|
||||
MinSize=16
|
||||
MaxSize=512
|
@ -81,9 +81,11 @@ qt_internal_add_module(Core
|
||||
global/qsysinfo.cpp global/qsysinfo.h
|
||||
global/qsystemdetection.h
|
||||
global/qtclasshelpermacros.h
|
||||
global/qtconfiginclude.h
|
||||
global/qtconfigmacros.h
|
||||
global/qtdeprecationmarkers.h
|
||||
global/qtenvironmentvariables.cpp global/qtenvironmentvariables.h
|
||||
global/qtenvironmentvariables_p.h
|
||||
global/qtnoop.h
|
||||
global/qtpreprocessorsupport.h
|
||||
global/qtrace_p.h
|
||||
@ -97,13 +99,19 @@ qt_internal_add_module(Core
|
||||
${core_version_tagging_files}
|
||||
global/qvolatile_p.h
|
||||
global/q20algorithm.h
|
||||
global/q20chrono.h
|
||||
global/q20functional.h
|
||||
global/q20iterator.h
|
||||
global/q20memory.h
|
||||
global/q20type_traits.h
|
||||
global/q23functional.h
|
||||
global/q23utility.cpp # remove once we have a user that tests this
|
||||
global/q23utility.h
|
||||
global/qxpfunctional.h
|
||||
global/qxptype_traits.h
|
||||
ipc/qsharedmemory.cpp ipc/qsharedmemory.h ipc/qsharedmemory_p.h
|
||||
ipc/qsystemsemaphore.cpp ipc/qsystemsemaphore.h ipc/qsystemsemaphore_p.h
|
||||
ipc/qtipccommon.cpp ipc/qtipccommon.h ipc/qtipccommon_p.h
|
||||
io/qabstractfileengine.cpp io/qabstractfileengine_p.h
|
||||
io/qbuffer.cpp io/qbuffer.h
|
||||
io/qdataurl.cpp io/qdataurl_p.h
|
||||
@ -138,6 +146,7 @@ qt_internal_add_module(Core
|
||||
io/qurlidna.cpp
|
||||
io/qurlquery.cpp io/qurlquery.h
|
||||
io/qurlrecode.cpp
|
||||
io/qzipreader_p.h io/qzipwriter_p.h io/qzip.cpp
|
||||
kernel/qabstracteventdispatcher.cpp kernel/qabstracteventdispatcher.h kernel/qabstracteventdispatcher_p.h
|
||||
kernel/qabstractnativeeventfilter.cpp kernel/qabstractnativeeventfilter.h
|
||||
kernel/qapplicationstatic.h
|
||||
@ -148,7 +157,7 @@ qt_internal_add_module(Core
|
||||
kernel/qcoreapplication_platform.h
|
||||
kernel/qcorecmdlineargs_p.h
|
||||
kernel/qcoreevent.cpp kernel/qcoreevent.h
|
||||
kernel/qdeadlinetimer.cpp kernel/qdeadlinetimer.h kernel/qdeadlinetimer_p.h
|
||||
kernel/qdeadlinetimer.cpp kernel/qdeadlinetimer.h
|
||||
kernel/qelapsedtimer.cpp kernel/qelapsedtimer.h
|
||||
kernel/qeventloop.cpp kernel/qeventloop.h kernel/qeventloop_p.h
|
||||
kernel/qfunctions_p.h
|
||||
@ -170,15 +179,13 @@ qt_internal_add_module(Core
|
||||
kernel/qproperty.cpp kernel/qproperty.h kernel/qproperty_p.h
|
||||
kernel/qpropertyprivate.h
|
||||
kernel/qsequentialiterable.cpp kernel/qsequentialiterable.h
|
||||
kernel/qsharedmemory.cpp kernel/qsharedmemory.h kernel/qsharedmemory_p.h
|
||||
kernel/qsignalmapper.cpp kernel/qsignalmapper.h
|
||||
kernel/qsocketnotifier.cpp kernel/qsocketnotifier.h
|
||||
kernel/qsystemerror.cpp kernel/qsystemerror_p.h
|
||||
kernel/qsystemsemaphore.cpp kernel/qsystemsemaphore.h kernel/qsystemsemaphore_p.h
|
||||
kernel/qtestsupport_core.cpp kernel/qtestsupport_core.h
|
||||
kernel/qtimer.cpp kernel/qtimer.h kernel/qtimer_p.h
|
||||
kernel/qtranslator.cpp kernel/qtranslator.h kernel/qtranslator_p.h
|
||||
kernel/qvariant.cpp kernel/qvariant.h
|
||||
kernel/qvariant.cpp kernel/qvariant.h kernel/qvariant_p.h
|
||||
kernel/qvariantmap.h kernel/qvarianthash.h kernel/qvariantlist.h
|
||||
plugin/qfactoryinterface.cpp plugin/qfactoryinterface.h
|
||||
plugin/qfactoryloader.cpp plugin/qfactoryloader_p.h
|
||||
@ -201,9 +208,6 @@ qt_internal_add_module(Core
|
||||
serialization/qjsonvalue.cpp serialization/qjsonvalue.h
|
||||
serialization/qjsonwriter.cpp serialization/qjsonwriter_p.h
|
||||
serialization/qtextstream.cpp serialization/qtextstream.h serialization/qtextstream_p.h
|
||||
serialization/qxmlstream.cpp serialization/qxmlstream.h serialization/qxmlstream_p.h
|
||||
serialization/qxmlstreamgrammar.cpp serialization/qxmlstreamgrammar_p.h
|
||||
serialization/qxmlstreamparser_p.h
|
||||
serialization/qxmlutils.cpp serialization/qxmlutils_p.h
|
||||
text/qanystringview.h
|
||||
text/qbytearray.cpp text/qbytearray.h text/qbytearray_p.h
|
||||
@ -216,6 +220,7 @@ qt_internal_add_module(Core
|
||||
text/qcollator.cpp text/qcollator.h text/qcollator_p.h
|
||||
text/qdoublescanprint_p.h
|
||||
text/qlatin1stringmatcher.cpp text/qlatin1stringmatcher.h
|
||||
text/qlatin1stringview.h
|
||||
text/qlocale.cpp text/qlocale.h text/qlocale_p.h
|
||||
text/qlocale_data_p.h
|
||||
text/qlocale_tools.cpp text/qlocale_tools_p.h
|
||||
@ -274,6 +279,7 @@ qt_internal_add_module(Core
|
||||
tools/qduplicatetracker_p.h
|
||||
tools/qflatmap_p.h
|
||||
tools/qfreelist.cpp tools/qfreelist_p.h
|
||||
tools/qfunctionaltools_impl.h
|
||||
tools/qhashfunctions.h
|
||||
tools/qiterator.h
|
||||
tools/qline.cpp tools/qline.h
|
||||
@ -298,6 +304,7 @@ qt_internal_add_module(Core
|
||||
tools/qsharedpointer.cpp tools/qsharedpointer.h
|
||||
tools/qsharedpointer_impl.h
|
||||
tools/qsize.cpp tools/qsize.h
|
||||
tools/qspan_p.h
|
||||
tools/qstack.h
|
||||
tools/qtaggedpointer.h
|
||||
tools/qtools_p.h
|
||||
@ -341,6 +348,8 @@ qt_internal_add_module(Core
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Qt6CoreDeploySupport.cmake"
|
||||
"${config_build_dir}/QtInstallPaths.cmake"
|
||||
${corelib_extra_cmake_files}
|
||||
POLICIES
|
||||
QTP0002
|
||||
)
|
||||
_qt_internal_setup_deploy_support()
|
||||
|
||||
@ -455,9 +464,6 @@ qt_internal_extend_target(Core
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION ANDROID
|
||||
SOURCES
|
||||
kernel/qsharedmemory_android.cpp
|
||||
kernel/qsystemsemaphore_android.cpp
|
||||
DEFINES
|
||||
LIBS_SUFFIX="_${ANDROID_ABI}.so"
|
||||
)
|
||||
@ -467,12 +473,11 @@ qt_internal_extend_target(Core CONDITION MSVC AND (TEST_architecture_arch STREQU
|
||||
"/BASE:0x67000000"
|
||||
)
|
||||
|
||||
# QtCore can't be compiled with -Wl,-no-undefined because it uses the
|
||||
# "environ" variable and FreeBSD does not include a weak symbol for it
|
||||
# in libc.
|
||||
qt_internal_extend_target(Core CONDITION FREEBSD
|
||||
LINK_OPTIONS
|
||||
"LINKER:--warn-unresolved-symbols"
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_xmlstream
|
||||
SOURCES
|
||||
serialization/qxmlstream.cpp serialization/qxmlstream.h serialization/qxmlstream_p.h
|
||||
serialization/qxmlstreamgrammar.cpp serialization/qxmlstreamgrammar_p.h
|
||||
serialization/qxmlstreamparser_p.h
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_animation
|
||||
@ -510,11 +515,10 @@ qt_internal_extend_target(Core CONDITION WIN32
|
||||
io/qwindowspipewriter.cpp io/qwindowspipewriter_p.h
|
||||
io/qntdll_p.h
|
||||
kernel/qcoreapplication_win.cpp
|
||||
kernel/qelapsedtimer_win.cpp
|
||||
kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h
|
||||
kernel/qfunctions_win.cpp kernel/qfunctions_win_p.h kernel/qfunctions_winrt_p.h
|
||||
kernel/qsharedmemory_win.cpp
|
||||
kernel/qsystemsemaphore_win.cpp
|
||||
ipc/qsharedmemory_win.cpp
|
||||
ipc/qsystemsemaphore_win.cpp
|
||||
kernel/qwineventnotifier.cpp kernel/qwineventnotifier.h kernel/qwineventnotifier_p.h
|
||||
kernel/qwinregistry.cpp kernel/qwinregistry_p.h
|
||||
plugin/qsystemlibrary.cpp plugin/qsystemlibrary_p.h
|
||||
@ -571,7 +575,6 @@ qt_internal_extend_target(Core CONDITION APPLE
|
||||
kernel/qcore_foundation.mm
|
||||
kernel/qcore_mac.mm kernel/qcore_mac_p.h
|
||||
kernel/qcoreapplication_mac.cpp
|
||||
kernel/qelapsedtimer_mac.cpp
|
||||
kernel/qeventdispatcher_cf.mm kernel/qeventdispatcher_cf_p.h
|
||||
LIBRARIES
|
||||
${FWCoreFoundation}
|
||||
@ -667,10 +670,6 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_thread
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_thread AND UNIX
|
||||
SOURCES
|
||||
thread/qwaitcondition_unix.cpp
|
||||
NO_UNITY_BUILD_SOURCES
|
||||
thread/qwaitcondition_unix.cpp
|
||||
# Temporary exclusion until this, https://codereview.qt-project.org/c/qt/qtbase/+/472013,
|
||||
# or this, https://codereview.qt-project.org/c/qt/qtbase/+/471184 addresses the issue.
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION APPLE AND QT_FEATURE_thread
|
||||
@ -817,7 +816,7 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_regularexpression
|
||||
WrapPCRE2::WrapPCRE2
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_openssl_linked AND QT_FEATURE_opensslv30
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_openssl_hash
|
||||
LIBRARIES
|
||||
WrapOpenSSL::WrapOpenSSL
|
||||
)
|
||||
@ -971,11 +970,6 @@ qt_internal_extend_target(Core CONDITION APPLE AND NOT MACOS
|
||||
${FWMobileCoreServices}
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE
|
||||
SOURCES
|
||||
kernel/qelapsedtimer_unix.cpp
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION ANDROID
|
||||
SOURCES
|
||||
io/qstandardpaths_android.cpp
|
||||
@ -1098,19 +1092,30 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_glib AND UNIX
|
||||
GLIB2::GLIB2
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_clock_gettime AND UNIX
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_clock_gettime
|
||||
LIBRARIES
|
||||
WrapRt::WrapRt
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION UNIX AND NOT ANDROID
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_posix_shm AND UNIX
|
||||
SOURCES
|
||||
kernel/qsharedmemory_posix.cpp
|
||||
kernel/qsharedmemory_systemv.cpp
|
||||
kernel/qsharedmemory_unix.cpp
|
||||
kernel/qsystemsemaphore_posix.cpp
|
||||
kernel/qsystemsemaphore_systemv.cpp
|
||||
kernel/qsystemsemaphore_unix.cpp
|
||||
ipc/qsharedmemory_posix.cpp
|
||||
LIBRARIES
|
||||
WrapRt::WrapRt
|
||||
)
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_sysv_shm
|
||||
SOURCES
|
||||
ipc/qsharedmemory_systemv.cpp
|
||||
)
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_posix_sem
|
||||
SOURCES
|
||||
ipc/qsystemsemaphore_posix.cpp
|
||||
LIBRARIES
|
||||
WrapRt::WrapRt
|
||||
)
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_sysv_sem
|
||||
SOURCES
|
||||
ipc/qsystemsemaphore_systemv.cpp
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION VXWORKS
|
||||
@ -1305,10 +1310,11 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_ctf AND QT_FEATURE_library
|
||||
tracing
|
||||
)
|
||||
|
||||
# These files are included by qmutex.cpp
|
||||
set_source_files_properties(
|
||||
thread/qmutex_mac.cpp
|
||||
thread/qmutex_unix.cpp
|
||||
PROPERTIES HEADER_FILE_ONLY ON) # special case: These files are included by qmutex.cpp!
|
||||
PROPERTIES HEADER_FILE_ONLY ON)
|
||||
|
||||
# Remove QT_NO_CAST_TO_ASCII to ensure that the symbols are included in the library.
|
||||
if(WIN32)
|
||||
|
@ -899,6 +899,38 @@ endfunction()
|
||||
# properties.
|
||||
function(_qt_internal_android_format_deployment_paths target)
|
||||
if(QT_BUILD_STANDALONE_TESTS OR QT_BUILDING_QT)
|
||||
set(android_deployment_paths_policy NEW)
|
||||
else()
|
||||
set(policy_path_properties
|
||||
QT_QML_IMPORT_PATH
|
||||
QT_QML_ROOT_PATH
|
||||
QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||
QT_ANDROID_EXTRA_PLUGINS
|
||||
QT_ANDROID_EXTRA_LIBS
|
||||
)
|
||||
|
||||
# Check if any of paths contains the value and stop the evaluation if all properties are
|
||||
# empty or -NOTFOUND
|
||||
set(has_android_paths FALSE)
|
||||
foreach(prop_name IN LISTS policy_path_properties)
|
||||
get_target_property(prop_value ${target} ${prop_name})
|
||||
if(prop_value)
|
||||
set(has_android_paths TRUE)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
if(NOT has_android_paths)
|
||||
return()
|
||||
endif()
|
||||
|
||||
__qt_internal_setup_policy(QTP0002 "6.6.0"
|
||||
"Target properties that specify android-specific paths may contain generator\
|
||||
expressions but they must evaluate to valid JSON strings.\
|
||||
Check https://doc.qt.io/qt-6/qt-cmake-policy-qtp0002.html for policy details."
|
||||
)
|
||||
qt6_policy(GET QTP0002 android_deployment_paths_policy)
|
||||
endif()
|
||||
if(android_deployment_paths_policy STREQUAL "NEW")
|
||||
# When building standalone tests or Qt itself we obligate developers to not use
|
||||
# windows paths when setting QT_* properties below, so their values are used as is when
|
||||
# generating deployment settings.
|
||||
|
@ -260,6 +260,9 @@ endfunction()
|
||||
# so the argument containing list will look as following:
|
||||
# -DLIST_ARGUMENT=item1[[;]]item2[[;]]...itemN.
|
||||
macro(_qt_internal_test_expect_pass _dir)
|
||||
if(WASM)
|
||||
return()
|
||||
endif()
|
||||
set(_test_option_args
|
||||
SIMULATE_IN_SOURCE
|
||||
NO_CLEAN_STEP
|
||||
|
@ -93,24 +93,32 @@ function(_qt_internal_create_moc_command infile outfile moc_flags moc_options
|
||||
set(extra_output_files "${outfile}.json")
|
||||
set(${out_json_file} "${extra_output_files}" PARENT_SCOPE)
|
||||
endif()
|
||||
string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
|
||||
|
||||
if(moc_target)
|
||||
set(_moc_parameters_file ${_moc_parameters_file}$<$<BOOL:$<CONFIG>>:_$<CONFIG>>)
|
||||
set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>")
|
||||
set(targetdefines "$<TARGET_PROPERTY:${moc_target},COMPILE_DEFINITIONS>")
|
||||
|
||||
set(targetincludes "$<$<BOOL:${targetincludes}>:-I$<JOIN:$<REMOVE_DUPLICATES:${targetincludes}>,\n-I>\n>")
|
||||
set(targetdefines "$<$<BOOL:${targetdefines}>:-D$<JOIN:$<REMOVE_DUPLICATES:${targetdefines}>,\n-D>\n>")
|
||||
set(targetincludes "$<$<BOOL:${targetincludes}>:-I$<JOIN:${targetincludes},;-I>>")
|
||||
set(targetdefines "$<$<BOOL:${targetdefines}>:-D$<JOIN:${targetdefines},;-D>>")
|
||||
string(REPLACE ">" "$<ANGLE-R>" _moc_escaped_parameters "${_moc_parameters}")
|
||||
string(REPLACE "," "$<COMMA>" _moc_escaped_parameters "${_moc_escaped_parameters}")
|
||||
|
||||
set(concatenated "$<$<BOOL:${targetincludes}>:${targetincludes};>$<$<BOOL:${targetdefines}>:${targetdefines};>$<$<BOOL:${_moc_escaped_parameters}>:${_moc_escaped_parameters};>")
|
||||
|
||||
set(concatenated "$<FILTER:$<REMOVE_DUPLICATES:${concatenated}>,EXCLUDE,^-[DI]$>")
|
||||
set(concatenated "$<JOIN:${concatenated},\n>")
|
||||
|
||||
file (GENERATE
|
||||
OUTPUT ${_moc_parameters_file}
|
||||
CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n"
|
||||
CONTENT "${concatenated}"
|
||||
)
|
||||
|
||||
set(concatenated)
|
||||
set(targetincludes)
|
||||
set(targetdefines)
|
||||
else()
|
||||
string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
|
||||
file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n")
|
||||
endif()
|
||||
|
||||
@ -121,8 +129,12 @@ function(_qt_internal_create_moc_command infile outfile moc_flags moc_options
|
||||
${_moc_working_dir}
|
||||
VERBATIM)
|
||||
set_source_files_properties(${infile} PROPERTIES SKIP_AUTOMOC ON)
|
||||
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON)
|
||||
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON)
|
||||
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON
|
||||
SKIP_AUTOUIC ON
|
||||
)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
|
||||
set_source_files_properties(${outfile} PROPERTIES SKIP_LINTING ON)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(qt6_generate_moc infile outfile )
|
||||
@ -434,6 +446,9 @@ function(qt6_add_big_resources outfiles )
|
||||
|
||||
_qt6_parse_qrc_file(${infile} _out_depends _rc_depends)
|
||||
set_source_files_properties(${infile} PROPERTIES SKIP_AUTOGEN ON)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
|
||||
set_source_files_properties(${tmpoutfile} PROPERTIES SKIP_LINTING ON)
|
||||
endif()
|
||||
add_custom_command(OUTPUT ${tmpoutfile}
|
||||
COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::rcc ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile}
|
||||
DEPENDS ${infile} ${_rc_depends} "${out_depends}" ${QT_CMAKE_EXPORT_NAMESPACE}::rcc
|
||||
@ -660,6 +675,26 @@ function(_qt_internal_finalize_executable target)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(_cat IN_FILE OUT_FILE)
|
||||
file(READ ${IN_FILE} CONTENTS)
|
||||
file(APPEND ${OUT_FILE} "${CONTENTS}\n")
|
||||
endfunction()
|
||||
|
||||
function(_qt_internal_finalize_batch name)
|
||||
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Core)
|
||||
|
||||
set(generated_blacklist_file "${CMAKE_CURRENT_BINARY_DIR}/BLACKLIST")
|
||||
get_target_property(blacklist_files "${name}" _qt_blacklist_files)
|
||||
file(WRITE "${generated_blacklist_file}" "")
|
||||
foreach(blacklist_file ${blacklist_files})
|
||||
_cat("${blacklist_file}" "${generated_blacklist_file}")
|
||||
endforeach()
|
||||
qt_internal_add_resource(${name} "batch_blacklist"
|
||||
PREFIX "/"
|
||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/BLACKLIST"
|
||||
BASE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endfunction()
|
||||
|
||||
# If a task needs to run before any targets are finalized in the current directory
|
||||
# scope, call this function and pass the ID of that task as the argument.
|
||||
function(_qt_internal_delay_finalization_until_after defer_id)
|
||||
@ -667,6 +702,7 @@ function(_qt_internal_delay_finalization_until_after defer_id)
|
||||
endfunction()
|
||||
|
||||
function(qt6_finalize_target target)
|
||||
set_property(TARGET ${target} PROPERTY _qt_expects_finalization FALSE)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19")
|
||||
cmake_language(DEFER GET_CALL_IDS ids_queued)
|
||||
get_directory_property(wait_for_ids qt_internal_finalizers_wait_for_ids)
|
||||
@ -1025,9 +1061,23 @@ function(qt6_extract_metatypes target)
|
||||
add_dependencies(${target}_automoc_json_extraction ${target}_autogen)
|
||||
_qt_internal_assign_to_internal_targets_folder(${target}_automoc_json_extraction)
|
||||
else()
|
||||
set(cmake_autogen_timestamp_file
|
||||
"${target_autogen_build_dir}/timestamp"
|
||||
)
|
||||
set(use_better_automoc_graph FALSE)
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.28.0"
|
||||
AND CMAKE_CROSS_CONFIGS)
|
||||
if(DEFINED QT_USE_BETTER_AUTOMOC_GRAPH)
|
||||
set(use_better_automoc_graph ${QT_USE_BETTER_AUTOMOC_GRAPH})
|
||||
else()
|
||||
set(use_better_automoc_graph TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(use_better_automoc_graph)
|
||||
set(cmake_autogen_timestamp_file
|
||||
"${target_autogen_build_dir}/timestamp_$<CONFIG>")
|
||||
else()
|
||||
set(cmake_autogen_timestamp_file
|
||||
"${target_autogen_build_dir}/timestamp")
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${type_list_file}
|
||||
DEPENDS ${QT_CMAKE_EXPORT_NAMESPACE}::cmake_automoc_parser
|
||||
@ -1485,6 +1535,13 @@ function(__qt_get_relative_resource_path_for_file output_alias file)
|
||||
get_property(alias SOURCE ${file} PROPERTY QT_RESOURCE_ALIAS)
|
||||
if (NOT alias)
|
||||
set(alias "${file}")
|
||||
if(IS_ABSOLUTE "${file}")
|
||||
message(FATAL_ERROR
|
||||
"The source file '${file}' was specified with an absolute path and is used in a Qt "
|
||||
"resource. Please set the QT_RESOURCE_ALIAS property on that source file to a "
|
||||
"relative path to make the file properly accessible via the resource system."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
set(${output_alias} ${alias} PARENT_SCOPE)
|
||||
endfunction()
|
||||
@ -1887,6 +1944,7 @@ function(_qt_internal_process_resource target resourceName)
|
||||
return()
|
||||
endif()
|
||||
set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/.rcc/${resourceName}.qrc")
|
||||
_qt_internal_expose_source_file_to_ide(${target} ${generatedResourceFile})
|
||||
|
||||
# Generate .qrc file:
|
||||
|
||||
@ -1907,10 +1965,15 @@ function(_qt_internal_process_resource target resourceName)
|
||||
set(file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
||||
endif()
|
||||
|
||||
get_property(is_empty SOURCE ${file} PROPERTY QT_DISCARD_FILE_CONTENTS)
|
||||
|
||||
### FIXME: escape file paths to be XML conform
|
||||
# <file ...>...</file>
|
||||
string(APPEND qrcContents " <file alias=\"${file_resource_path}\">")
|
||||
string(APPEND qrcContents "${file}</file>\n")
|
||||
string(APPEND qrcContents " <file alias=\"${file_resource_path}\"")
|
||||
if(is_empty)
|
||||
string(APPEND qrcContents " empty=\"true\"")
|
||||
endif()
|
||||
string(APPEND qrcContents ">${file}</file>\n")
|
||||
list(APPEND files "${file}")
|
||||
|
||||
set(scope_args)
|
||||
@ -2017,6 +2080,9 @@ function(_qt_internal_process_resource target resourceName)
|
||||
SKIP_UNITY_BUILD_INCLUSION TRUE
|
||||
SKIP_PRECOMPILE_HEADERS TRUE
|
||||
)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
|
||||
set_source_files_properties(${generatedOutfile} ${scope_args} PROPERTIES SKIP_LINTING ON)
|
||||
endif()
|
||||
|
||||
get_target_property(target_source_dir ${target} SOURCE_DIR)
|
||||
if(NOT target_source_dir STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
@ -2804,8 +2870,8 @@ macro(qt6_standard_project_setup)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Enable folder support for IDEs. A future CMake version might enable this by default.
|
||||
# See CMake issue #21695.
|
||||
# Enable folder support for IDEs. CMake >= 3.26 enables USE_FOLDERS by default but this is
|
||||
# guarded by CMake policy CMP0143.
|
||||
get_property(__qt_use_folders GLOBAL PROPERTY USE_FOLDERS)
|
||||
if(__qt_use_folders OR "${__qt_use_folders}" STREQUAL "")
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
@ -23,6 +23,14 @@ function(_qt_internal_wasm_add_target_helpers target)
|
||||
|
||||
set(APPNAME ${_target_output_name})
|
||||
|
||||
# Shared library builds preload plugins and qml imports by default.
|
||||
# The json files are generated by scripts in qtbase/util/wasm/preload
|
||||
if (QT_FEATURE_shared)
|
||||
set(PRELOAD "preload: ['qt_plugins.json', 'qt_qml_imports.json'],")
|
||||
else()
|
||||
set(PRELOAD "")
|
||||
endif()
|
||||
|
||||
get_target_property(target_output_directory ${target} RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
get_target_property(is_test ${target} _qt_is_test_executable)
|
||||
@ -87,7 +95,7 @@ endfunction()
|
||||
function(_qt_internal_add_wasm_extra_exported_methods target)
|
||||
get_target_property(wasm_extra_exported_methods "${target}" QT_WASM_EXTRA_EXPORTED_METHODS)
|
||||
|
||||
set(wasm_default_exported_methods "UTF16ToString,stringToUTF16,JSEvents,specialHTMLTargets")
|
||||
set(wasm_default_exported_methods "UTF16ToString,stringToUTF16,JSEvents,specialHTMLTargets,FS")
|
||||
|
||||
if(NOT wasm_extra_exported_methods)
|
||||
set(wasm_extra_exported_methods ${QT_WASM_EXTRA_EXPORTED_METHODS})
|
||||
|
@ -1121,7 +1121,7 @@ void QAbstractAnimation::setDirection(Direction direction)
|
||||
return;
|
||||
}
|
||||
|
||||
Qt::beginPropertyUpdateGroup();
|
||||
const QScopedPropertyUpdateGroup guard;
|
||||
const int oldCurrentLoop = d->currentLoop;
|
||||
if (state() == Stopped) {
|
||||
if (direction == Backward) {
|
||||
@ -1148,7 +1148,6 @@ void QAbstractAnimation::setDirection(Direction direction)
|
||||
if (d->currentLoop != oldCurrentLoop)
|
||||
d->currentLoop.notify();
|
||||
d->direction.notify();
|
||||
Qt::endPropertyUpdateGroup();
|
||||
}
|
||||
|
||||
QBindable<QAbstractAnimation::Direction> QAbstractAnimation::bindableDirection()
|
||||
|
@ -303,6 +303,15 @@ int QMetaType::idHelper() const
|
||||
return registerHelper(d_ptr);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(sharedmemory)
|
||||
#include "qsharedmemory.h"
|
||||
|
||||
void QSharedMemory::setNativeKey(const QString &key)
|
||||
{
|
||||
setNativeKey(key, QNativeIpcKey::legacyDefaultTypeForOs());
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "qvariant.h"
|
||||
|
||||
// these implementations aren't as efficient as they used to be prior to
|
||||
@ -474,3 +483,135 @@ void QXmlStreamWriter::writeStartElement(const QString &namespaceUri, const QStr
|
||||
// order sections alphabetically to reduce chances of merge conflicts
|
||||
|
||||
#endif // QT_CORE_REMOVED_SINCE(6, 5)
|
||||
|
||||
#if QT_CORE_REMOVED_SINCE(6, 6)
|
||||
|
||||
#include "qmessageauthenticationcode.h"
|
||||
|
||||
QMessageAuthenticationCode::QMessageAuthenticationCode(QCryptographicHash::Algorithm method,
|
||||
const QByteArray &key)
|
||||
: QMessageAuthenticationCode(method, qToByteArrayViewIgnoringNull(key)) {}
|
||||
|
||||
void QMessageAuthenticationCode::setKey(const QByteArray &key)
|
||||
{
|
||||
setKey(qToByteArrayViewIgnoringNull(key));
|
||||
}
|
||||
|
||||
void QMessageAuthenticationCode::addData(const QByteArray &data)
|
||||
{
|
||||
addData(qToByteArrayViewIgnoringNull(data));
|
||||
}
|
||||
|
||||
QByteArray QMessageAuthenticationCode::hash(const QByteArray &msg, const QByteArray &key,
|
||||
QCryptographicHash::Algorithm method)
|
||||
{
|
||||
return hash(qToByteArrayViewIgnoringNull(msg),
|
||||
qToByteArrayViewIgnoringNull(key), method);
|
||||
}
|
||||
|
||||
#include "qobject.h" // inlined API
|
||||
|
||||
#include "qrunnable.h"
|
||||
|
||||
QRunnable *QRunnable::create(std::function<void()> functionToRun)
|
||||
{
|
||||
return QRunnable::create<std::function<void()>>(std::move(functionToRun));
|
||||
}
|
||||
|
||||
#include "qstring.h"
|
||||
|
||||
qsizetype QString::toUcs4_helper(const ushort *uc, qsizetype length, uint *out)
|
||||
{
|
||||
return toUcs4_helper(reinterpret_cast<const char16_t *>(uc), length,
|
||||
reinterpret_cast<char32_t *>(out));
|
||||
}
|
||||
|
||||
#if QT_CONFIG(thread)
|
||||
#include "qreadwritelock.h"
|
||||
|
||||
bool QReadWriteLock::tryLockForRead()
|
||||
{
|
||||
return tryLockForRead(0);
|
||||
}
|
||||
|
||||
bool QReadWriteLock::tryLockForWrite()
|
||||
{
|
||||
return tryLockForWrite(0);
|
||||
}
|
||||
|
||||
#include "qthreadpool.h"
|
||||
#include "private/qthreadpool_p.h"
|
||||
|
||||
void QThreadPool::start(std::function<void()> functionToRun, int priority)
|
||||
{
|
||||
if (!functionToRun)
|
||||
return;
|
||||
start(QRunnable::create(std::move(functionToRun)), priority);
|
||||
}
|
||||
|
||||
bool QThreadPool::tryStart(std::function<void()> functionToRun)
|
||||
{
|
||||
if (!functionToRun)
|
||||
return false;
|
||||
|
||||
Q_D(QThreadPool);
|
||||
QMutexLocker locker(&d->mutex);
|
||||
if (!d->allThreads.isEmpty() && d->areAllThreadsActive())
|
||||
return false;
|
||||
|
||||
QRunnable *runnable = QRunnable::create(std::move(functionToRun));
|
||||
if (d->tryStart(runnable))
|
||||
return true;
|
||||
delete runnable;
|
||||
return false;
|
||||
}
|
||||
|
||||
void QThreadPool::startOnReservedThread(std::function<void()> functionToRun)
|
||||
{
|
||||
if (!functionToRun)
|
||||
return releaseThread();
|
||||
|
||||
startOnReservedThread(QRunnable::create(std::move(functionToRun)));
|
||||
}
|
||||
|
||||
#endif // QT_CONFIG(thread)
|
||||
|
||||
#include "qxmlstream.h"
|
||||
|
||||
QStringView QXmlStreamAttributes::value(const QString &namespaceUri, const QString &name) const
|
||||
{
|
||||
return value(qToAnyStringViewIgnoringNull(namespaceUri), qToAnyStringViewIgnoringNull(name));
|
||||
}
|
||||
|
||||
QStringView QXmlStreamAttributes::value(const QString &namespaceUri, QLatin1StringView name) const
|
||||
{
|
||||
return value(qToAnyStringViewIgnoringNull(namespaceUri), QAnyStringView(name));
|
||||
}
|
||||
|
||||
QStringView QXmlStreamAttributes::value(QLatin1StringView namespaceUri, QLatin1StringView name) const
|
||||
{
|
||||
return value(QAnyStringView(namespaceUri), QAnyStringView(name));
|
||||
}
|
||||
|
||||
QStringView QXmlStreamAttributes::value(const QString &qualifiedName) const
|
||||
{
|
||||
return value(qToAnyStringViewIgnoringNull(qualifiedName));
|
||||
}
|
||||
|
||||
QStringView QXmlStreamAttributes::value(QLatin1StringView qualifiedName) const
|
||||
{
|
||||
return value(QAnyStringView(qualifiedName));
|
||||
}
|
||||
|
||||
// inlined API
|
||||
#if QT_CONFIG(thread)
|
||||
#include "qmutex.h"
|
||||
#include "qreadwritelock.h"
|
||||
#include "qsemaphore.h"
|
||||
#endif
|
||||
|
||||
// #include "qotherheader.h"
|
||||
// // implement removed functions from qotherheader.h
|
||||
// order sections alphabetically to reduce chances of merge conflicts
|
||||
|
||||
#endif // QT_CORE_REMOVED_SINCE(6, 6)
|
||||
|
@ -98,6 +98,18 @@ clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
}
|
||||
")
|
||||
|
||||
# close_range
|
||||
qt_config_compile_test(close_range
|
||||
LABEL "close_range()"
|
||||
CODE
|
||||
"#include <unistd.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
return close_range(3, 1024, 0) != 0;
|
||||
}
|
||||
")
|
||||
|
||||
# cloexec
|
||||
qt_config_compile_test(cloexec
|
||||
LABEL "O_CLOEXEC"
|
||||
@ -125,7 +137,6 @@ int pipes[2];
|
||||
}
|
||||
")
|
||||
|
||||
# special case begin
|
||||
# cxx11_future
|
||||
if (UNIX AND NOT ANDROID AND NOT QNX AND NOT INTEGRITY)
|
||||
set(cxx11_future_TEST_LIBRARIES pthread)
|
||||
@ -146,7 +157,6 @@ std::future<int> f = std::async([]() { return 42; });
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
# special case end
|
||||
|
||||
# cxx11_random
|
||||
qt_config_compile_test(cxx11_random
|
||||
@ -297,49 +307,71 @@ inotify_rm_watch(0, 1);
|
||||
}
|
||||
")
|
||||
|
||||
# ipc_sysv
|
||||
qt_config_compile_test(ipc_sysv
|
||||
LABEL "SysV IPC"
|
||||
qt_config_compile_test(sysv_shm
|
||||
LABEL "System V/XSI shared memory"
|
||||
CODE
|
||||
"#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/sem.h>
|
||||
#include <sys/shm.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* BEGIN TEST: */
|
||||
key_t unix_key = ftok(\"test\", 'Q');
|
||||
semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);
|
||||
shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL);
|
||||
shmctl(0, 0, (struct shmid_ds *)(0));
|
||||
/* END TEST: */
|
||||
key_t unix_key = ftok(\"test\", 'Q');
|
||||
shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL);
|
||||
shmctl(0, 0, (struct shmid_ds *)(0));
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
qt_config_compile_test(sysv_sem
|
||||
LABEL "System V/XSI semaphores"
|
||||
CODE
|
||||
"#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/sem.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
key_t unix_key = ftok(\"test\", 'Q');
|
||||
semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
# ipc_posix
|
||||
if (LINUX)
|
||||
set(ipc_posix_TEST_LIBRARIES pthread rt)
|
||||
set(ipc_posix_TEST_LIBRARIES pthread WrapRt::WrapRt)
|
||||
endif()
|
||||
qt_config_compile_test(ipc_posix
|
||||
LABEL "POSIX IPC"
|
||||
qt_config_compile_test(posix_shm
|
||||
LABEL "POSIX shared memory"
|
||||
LIBRARIES
|
||||
"${ipc_posix_TEST_LIBRARIES}"
|
||||
CODE
|
||||
"#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);
|
||||
shm_unlink(\"test\");
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
qt_config_compile_test(posix_sem
|
||||
LABEL "POSIX semaphores"
|
||||
LIBRARIES
|
||||
"${ipc_posix_TEST_LIBRARIES}"
|
||||
CODE
|
||||
"#include <sys/types.h>
|
||||
#include <semaphore.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* BEGIN TEST: */
|
||||
sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));
|
||||
shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);
|
||||
shm_unlink(\"test\");
|
||||
/* END TEST: */
|
||||
sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
@ -531,7 +563,12 @@ qt_feature("clock-monotonic" PUBLIC
|
||||
CONDITION QT_FEATURE_clock_gettime AND TEST_clock_monotonic
|
||||
)
|
||||
qt_feature_definition("clock-monotonic" "QT_NO_CLOCK_MONOTONIC" NEGATE VALUE "1")
|
||||
qt_feature("doubleconversion" PUBLIC PRIVATE
|
||||
qt_feature("close_range" PRIVATE
|
||||
LABEL "close_range()"
|
||||
CONDITION QT_FEATURE_process AND TEST_close_range
|
||||
AUTODETECT UNIX
|
||||
)
|
||||
qt_feature("doubleconversion" PRIVATE
|
||||
LABEL "DoubleConversion"
|
||||
)
|
||||
qt_feature_definition("doubleconversion" "QT_NO_DOUBLECONVERSION" NEGATE VALUE "1")
|
||||
@ -592,9 +629,11 @@ qt_feature("inotify" PUBLIC PRIVATE
|
||||
)
|
||||
qt_feature_definition("inotify" "QT_NO_INOTIFY" NEGATE VALUE "1")
|
||||
qt_feature("ipc_posix"
|
||||
LABEL "Using POSIX IPC"
|
||||
AUTODETECT NOT WIN32 AND ( ( APPLE AND QT_FEATURE_appstore_compliant ) OR NOT TEST_ipc_sysv )
|
||||
CONDITION TEST_ipc_posix
|
||||
LABEL "Defaulting legacy IPC to POSIX"
|
||||
CONDITION TEST_posix_shm AND TEST_posix_sem AND (
|
||||
FEATURE_ipc_posix OR (APPLE AND QT_FEATURE_appstore_compliant)
|
||||
OR NOT TEST_sysv_shm OR NOT TEST_sysv_sem
|
||||
)
|
||||
)
|
||||
qt_feature_definition("ipc_posix" "QT_POSIX_IPC")
|
||||
qt_feature("journald" PRIVATE
|
||||
@ -662,6 +701,14 @@ qt_feature("poll_select" PRIVATE
|
||||
EMIT_IF NOT WIN32
|
||||
)
|
||||
qt_feature_definition("poll_select" "QT_NO_NATIVE_POLL")
|
||||
qt_feature("posix_sem" PRIVATE
|
||||
LABEL "POSIX semaphores"
|
||||
CONDITION TEST_posix_sem
|
||||
)
|
||||
qt_feature("posix_shm" PRIVATE
|
||||
LABEL "POSIX shared memory"
|
||||
CONDITION TEST_posix_shm AND UNIX
|
||||
)
|
||||
qt_feature("qqnx_pps" PRIVATE
|
||||
LABEL "PPS"
|
||||
CONDITION PPS_FOUND
|
||||
@ -684,6 +731,14 @@ qt_feature("syslog" PRIVATE
|
||||
AUTODETECT OFF
|
||||
CONDITION TEST_syslog
|
||||
)
|
||||
qt_feature("sysv_sem" PRIVATE
|
||||
LABEL "System V / XSI semaphores"
|
||||
CONDITION TEST_sysv_sem
|
||||
)
|
||||
qt_feature("sysv_shm" PRIVATE
|
||||
LABEL "System V / XSI shared memory"
|
||||
CONDITION TEST_sysv_shm
|
||||
)
|
||||
qt_feature("threadsafe-cloexec"
|
||||
LABEL "Threadsafe pipe creation"
|
||||
CONDITION TEST_cloexec
|
||||
@ -705,7 +760,7 @@ qt_feature("sharedmemory" PUBLIC
|
||||
SECTION "Kernel"
|
||||
LABEL "QSharedMemory"
|
||||
PURPOSE "Provides access to a shared memory segment."
|
||||
CONDITION ( ANDROID OR WIN32 OR ( NOT VXWORKS AND ( TEST_ipc_sysv OR TEST_ipc_posix ) ) )
|
||||
CONDITION WIN32 OR TEST_sysv_shm OR TEST_posix_shm
|
||||
)
|
||||
qt_feature_definition("sharedmemory" "QT_NO_SHAREDMEMORY" NEGATE VALUE "1")
|
||||
qt_feature("shortcut" PUBLIC
|
||||
@ -718,7 +773,7 @@ qt_feature("systemsemaphore" PUBLIC
|
||||
SECTION "Kernel"
|
||||
LABEL "QSystemSemaphore"
|
||||
PURPOSE "Provides a general counting system semaphore."
|
||||
CONDITION ( NOT INTEGRITY AND NOT VXWORKS AND NOT rtems ) AND ( ANDROID OR WIN32 OR TEST_ipc_sysv OR TEST_ipc_posix )
|
||||
CONDITION WIN32 OR TEST_sysv_sem OR TEST_posix_sem
|
||||
)
|
||||
qt_feature_definition("systemsemaphore" "QT_NO_SYSTEMSEMAPHORE" NEGATE VALUE "1")
|
||||
qt_feature("xmlstream" PUBLIC
|
||||
@ -729,23 +784,21 @@ qt_feature("xmlstream" PUBLIC
|
||||
qt_feature("cpp-winrt" PRIVATE PUBLIC
|
||||
LABEL "cpp/winrt base"
|
||||
PURPOSE "basic cpp/winrt language projection support"
|
||||
AUTODETECT WIN32
|
||||
CONDITION WIN32 AND TEST_cpp_winrt
|
||||
)
|
||||
qt_feature_definition("xmlstream" "QT_NO_XMLSTREAM" NEGATE VALUE "1")
|
||||
qt_feature("xmlstreamreader" PUBLIC
|
||||
SECTION "Kernel"
|
||||
LABEL "QXmlStreamReader"
|
||||
PURPOSE "Provides a well-formed XML parser with a simple streaming API."
|
||||
CONDITION QT_FEATURE_xmlstream
|
||||
)
|
||||
qt_feature_definition("xmlstreamreader" "QT_NO_XMLSTREAMREADER" NEGATE VALUE "1")
|
||||
qt_feature("xmlstreamwriter" PUBLIC
|
||||
SECTION "Kernel"
|
||||
LABEL "QXmlStreamWriter"
|
||||
PURPOSE "Provides a XML writer with a simple streaming API."
|
||||
CONDITION QT_FEATURE_xmlstream
|
||||
)
|
||||
qt_feature_definition("xmlstreamwriter" "QT_NO_XMLSTREAMWRITER" NEGATE VALUE "1")
|
||||
qt_feature("textdate" PUBLIC
|
||||
SECTION "Data structures"
|
||||
LABEL "Text Date"
|
||||
@ -963,22 +1016,31 @@ qt_feature("permissions" PUBLIC
|
||||
SECTION "Utilities"
|
||||
LABEL "Application permissions"
|
||||
PURPOSE "Provides support for requesting user permission to access restricted data or APIs"
|
||||
CONDITION APPLE OR ANDROID OR WASM
|
||||
)
|
||||
qt_feature("openssl-hash" PRIVATE
|
||||
LABEL "OpenSSL based cryptographic hash"
|
||||
AUTODETECT OFF
|
||||
CONDITION QT_FEATURE_openssl_linked AND QT_FEATURE_opensslv30
|
||||
PURPOSE "Uses OpenSSL based implementation of cryptographic hash algorithms."
|
||||
)
|
||||
|
||||
qt_configure_add_summary_section(NAME "Qt Core")
|
||||
qt_configure_add_summary_entry(ARGS "backtrace")
|
||||
qt_configure_add_summary_entry(ARGS "doubleconversion")
|
||||
qt_configure_add_summary_entry(ARGS "system-doubleconversion")
|
||||
qt_configure_add_summary_entry(ARGS "forkfd_pidfd" CONDITION LINUX)
|
||||
qt_configure_add_summary_entry(ARGS "glib")
|
||||
qt_configure_add_summary_entry(ARGS "icu")
|
||||
qt_configure_add_summary_entry(ARGS "system-libb2")
|
||||
qt_configure_add_summary_entry(ARGS "mimetype-database")
|
||||
qt_configure_add_summary_entry(ARGS "cpp-winrt")
|
||||
qt_configure_add_summary_entry(ARGS "permissions")
|
||||
qt_configure_add_summary_entry(ARGS "ipc_posix" CONDITION UNIX)
|
||||
qt_configure_add_summary_entry(
|
||||
TYPE "firstAvailableFeature"
|
||||
ARGS "etw lttng ctf"
|
||||
MESSAGE "Tracing backend"
|
||||
)
|
||||
qt_configure_add_summary_entry(ARGS "openssl-hash")
|
||||
qt_configure_add_summary_section(NAME "Logging backends")
|
||||
qt_configure_add_summary_entry(ARGS "journald")
|
||||
qt_configure_add_summary_entry(ARGS "syslog")
|
||||
@ -990,11 +1052,6 @@ qt_configure_add_summary_entry(
|
||||
)
|
||||
qt_configure_add_summary_entry(ARGS "pcre2")
|
||||
qt_configure_add_summary_entry(ARGS "system-pcre2")
|
||||
qt_configure_add_summary_entry(
|
||||
ARGS "forkfd_pidfd"
|
||||
CONDITION LINUX
|
||||
)
|
||||
qt_configure_add_summary_entry(ARGS "permissions")
|
||||
qt_configure_end_summary_section() # end of "Qt Core" section
|
||||
qt_configure_add_report_entry(
|
||||
TYPE NOTE
|
||||
|
@ -25,15 +25,6 @@ while (i.hasNext())
|
||||
float f = i.next();
|
||||
//! [6]
|
||||
|
||||
|
||||
//! [7]
|
||||
QSetIterator<QString> i(set);
|
||||
i.toBack();
|
||||
while (i.hasPrevious())
|
||||
QString s = i.previous();
|
||||
//! [7]
|
||||
|
||||
|
||||
//! [8]
|
||||
QList<float> list;
|
||||
...
|
||||
|
@ -26,3 +26,7 @@
|
||||
//! [3]
|
||||
rcc -binary myresource.qrc -o myresource.rcc
|
||||
//! [3]
|
||||
|
||||
//! [4]
|
||||
<file empty="true">Button.qml</file>
|
||||
//! [4]
|
||||
|
@ -45,7 +45,7 @@ settings.value("HKEY_CURRENT_USER\\MySoft\\Star Runner\\Galaxy\\Default"); // re
|
||||
|
||||
|
||||
//! [7]
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_DARWIN
|
||||
QSettings settings("grenoullelogique.fr", "Squash");
|
||||
#else
|
||||
QSettings settings("Grenoulle Logique", "Squash");
|
||||
|
@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
//! [0]
|
||||
QSystemSemaphore sem("market", 3, QSystemSemaphore::Create);
|
||||
QSystemSemaphore sem(QSystemSemaphore::platformSafeKey("market"), 3, QSystemSemaphore::Create);
|
||||
// resources available == 3
|
||||
sem.acquire(); // resources available == 2
|
||||
sem.acquire(); // resources available == 1
|
||||
@ -13,7 +13,7 @@ sem.release(2); // resources available == 3
|
||||
|
||||
|
||||
//! [1]
|
||||
QSystemSemaphore sem("market", 5, QSystemSemaphore::Create);
|
||||
QSystemSemaphore sem(QSystemSemaphore::platformSafeKey("market"), 5, QSystemSemaphore::Create);
|
||||
for (int i = 0; i < 5; ++i) // acquire all 5 resources
|
||||
sem.acquire();
|
||||
sem.release(5); // release the 5 resources
|
||||
|
@ -239,9 +239,9 @@ auto future = QtConcurrent::run([] {
|
||||
|
||||
//! [20]
|
||||
QObject *context = ...;
|
||||
auto future = cachedResultsReady ? QtFuture::makeReadyFuture(results)
|
||||
: QtConcurrent::run([] { /* compute results */});
|
||||
auto continuation = future.then(context, [] (Results results) {
|
||||
auto future = cachedResultsReady ? QtFuture::makeReadyValueFuture(result)
|
||||
: QtConcurrent::run([] { /* compute result */});
|
||||
auto continuation = future.then(context, [] (Result result) {
|
||||
// Runs in the context's thread
|
||||
}).then([] {
|
||||
// May or may not run in the context's thread
|
||||
@ -399,3 +399,44 @@ p.start();
|
||||
p.addResult(42);
|
||||
p.finish();
|
||||
//! [31]
|
||||
|
||||
//! [32]
|
||||
const std::vector<int> values{1, 2, 3};
|
||||
auto f = QtFuture::makeReadyRangeFuture(values);
|
||||
//! [32]
|
||||
|
||||
//! [33]
|
||||
auto f = QtFuture::makeReadyRangeFuture({1, 2, 3});
|
||||
//! [33]
|
||||
|
||||
//! [34]
|
||||
const int count = f.resultCount(); // count == 3
|
||||
const auto results = f.results(); // results == { 1, 2, 3 }
|
||||
//! [34]
|
||||
|
||||
//! [35]
|
||||
auto f = QtFuture::makeReadyValueFuture(std::make_unique<int>(42));
|
||||
...
|
||||
const int result = *f.takeResult(); // result == 42
|
||||
//! [35]
|
||||
|
||||
//! [36]
|
||||
auto f = QtFuture::makeReadyVoidFuture();
|
||||
...
|
||||
const bool started = f.isStarted(); // started == true
|
||||
const bool running = f.isRunning(); // running == false
|
||||
const bool finished = f.isFinished(); // finished == true
|
||||
//! [36]
|
||||
|
||||
//! [37]
|
||||
QObject *context = ...;
|
||||
auto future = ...;
|
||||
auto continuation = future.then(context, [context](Result result) {
|
||||
// ...
|
||||
}).onCanceled([context = QPointer(context)] {
|
||||
if (!context)
|
||||
return; // context was destroyed already
|
||||
// handle cancellation
|
||||
});
|
||||
|
||||
//! [37]
|
||||
|
@ -35,6 +35,12 @@ sem.tryAcquire(250, 1000); // sem.available() == 5, waits 1000 milliseconds a
|
||||
sem.tryAcquire(3, 30000); // sem.available() == 2, returns true without waiting
|
||||
//! [3]
|
||||
|
||||
//! [tryAcquire-QDeadlineTimer]
|
||||
QSemaphore sem(5); // sem.available() == 5
|
||||
sem.tryAcquire(250, QDeadlineTimer(1000)); // sem.available() == 5, waits 1000 milliseconds and returns false
|
||||
sem.tryAcquire(3, QDeadlineTimer(30s)); // sem.available() == 2, returns true without waiting
|
||||
//! [tryAcquire-QDeadlineTimer]
|
||||
|
||||
//! [4]
|
||||
// ... do something that may throw or return early
|
||||
sem.release();
|
||||
|
@ -11,3 +11,18 @@ qt_ntfs_permission_lookup++; // turn checking on
|
||||
qt_ntfs_permission_lookup--; // turn it off again
|
||||
//! [1]
|
||||
|
||||
//! [raii]
|
||||
void complexFunction()
|
||||
{
|
||||
QNtfsPermissionCheckGuard permissionGuard; // check is enabled
|
||||
|
||||
// do complex things here that need permission check enabled
|
||||
|
||||
} // as the guard goes out of scope the check is disabled
|
||||
//! [raii]
|
||||
|
||||
//! [free-funcs]
|
||||
qAreNtfsPermissionChecksEnabled(); // check status
|
||||
qEnableNtfsPermissionChecks(); // turn checking on
|
||||
qDisableNtfsPermissionChecks(); // turn it off again
|
||||
//! [free-funcs]
|
||||
|
@ -1,6 +1,8 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
#include <QString>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
//! [0]
|
||||
@ -21,3 +23,24 @@ using namespace Qt::StringLiterals;
|
||||
QLatin1StringView world("world");
|
||||
QString message = hello % el % world % QChar('!');
|
||||
//! [5]
|
||||
|
||||
//! [6]
|
||||
QString str("QStringBuilder");
|
||||
|
||||
// "s" type is deduced as QStringBuilder
|
||||
auto s = "Like hot glue, " % str % " concatenates strings";
|
||||
|
||||
// Similarly the return type of this lambda is deduced as QStringBuilder
|
||||
auto concatenateStr = []() {
|
||||
return "Like hot glue, " % str % " concatenates strings";
|
||||
};
|
||||
//! [6]
|
||||
|
||||
//! [7]
|
||||
QString s = "Like hot glue, " % str % " concatenates strings";
|
||||
|
||||
// With a lambda, specify a trailing return type
|
||||
auto concatenateStr = []() -> QString {
|
||||
return "Like hot glue, " % str % " concatenates strings";
|
||||
};
|
||||
//! [7]
|
||||
|
@ -6,6 +6,7 @@
|
||||
\title CBOR Support in Qt
|
||||
\ingroup qt-basic-concepts
|
||||
\brief An overview of CBOR support in Qt.
|
||||
\ingroup explanations-dataprocessingandio
|
||||
|
||||
\ingroup frameworks-technologies
|
||||
|
||||
|
@ -344,7 +344,7 @@ Set \c QT_NO_COLLECT_BUILD_TREE_APK_DEPS to \c TRUE to disable this behavior.
|
||||
|
||||
When using CMake version 3.21 or later, the build system collects the locations of
|
||||
imported shared library targets that might be relevant for deployment.
|
||||
The collected targets are those that are reachable from the the directory scope
|
||||
The collected targets are those that are reachable from the directory scope
|
||||
of the currently processed executable target. That includes the target's source directory
|
||||
scope and its parents.
|
||||
The collected locations are passed to \l androiddeployqt for deployment consideration when
|
||||
|
@ -444,6 +444,33 @@ the property value overrides the runtime path where the resource file is found.
|
||||
\sa{The Qt Resource System}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page cmake-source-file-property-qt-discard-file-contents.html
|
||||
\ingroup cmake-source-file-properties-qtcore
|
||||
|
||||
\title QT_DISCARD_FILE_CONTENTS
|
||||
\target cmake-source-file-property-QT_DISCARD_FILE_CONTENTS
|
||||
|
||||
\summary {Specifies that the given files should be empty in the resource file system}
|
||||
|
||||
\cmakepropertysince 6.6
|
||||
\preliminarycmakeproperty
|
||||
|
||||
When using the target-based variant of \l{qt6_add_resources}{qt_add_resources}
|
||||
or \l{qt_add_qml_module}, setting this property to \c TRUE causes the file
|
||||
contents to be omitted when creating the resource file system. The file name is
|
||||
retained.
|
||||
|
||||
This is useful if you want to strip QML source code from the binary.
|
||||
|
||||
\note If you omit the QML source code from the binary, the QML engine has to
|
||||
rely on the compilation units created by \l{qmlcachegen} or \l{qmlsc}.
|
||||
Those are tied to the specific version of Qt they were built with. If you change
|
||||
the version of Qt your application uses, they can't be loaded anymore.
|
||||
|
||||
\sa{The Qt Resource System}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page cmake-target-property-qt-wasm-pthread-pool-size.html
|
||||
\ingroup cmake-properties-qtcore
|
||||
|
63
src/corelib/doc/src/cmake/policy/qtp0002.qdoc
Normal file
63
src/corelib/doc/src/cmake/policy/qtp0002.qdoc
Normal file
@ -0,0 +1,63 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
/*!
|
||||
\page qt-cmake-policy-qtp0002.html
|
||||
\ingroup qt-cmake-policies
|
||||
|
||||
\title QTP0002
|
||||
\keyword qt_cmake_policy_qtp0002
|
||||
|
||||
\summary {Target properties that specify Android-specific paths may contain generator expressions.}
|
||||
|
||||
This policy was introduced in Qt 6.6. It changes the processing of target
|
||||
properties that specify Android-specific paths:
|
||||
\list
|
||||
\li \l QT_QML_IMPORT_PATH
|
||||
\li \l QT_QML_ROOT_PATH
|
||||
\li \l QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||
\li \l QT_ANDROID_EXTRA_PLUGINS
|
||||
\li \l QT_ANDROID_EXTRA_LIBS
|
||||
\endlist
|
||||
|
||||
The \c OLD behavior of this policy doesn't allow generator expressions in the
|
||||
target properties that specify Android-specific paths but implicitly converts
|
||||
the specified paths to valid JSON strings.
|
||||
|
||||
The \c NEW behavior of this policy allows using generator expressions in the
|
||||
target properties that specify Android-specific paths, but they must evaluate to
|
||||
valid JSON strings.
|
||||
|
||||
The following value of the \l QT_ANDROID_EXTRA_PLUGINS property is converted to
|
||||
a valid JSON string if you set the policy to OLD, but leads to an error if the
|
||||
policy is set to NEW:
|
||||
\badcode
|
||||
set_target_properties(
|
||||
QT_ANDROID_EXTRA_PLUGINS "\\path\\to\\MyPlugin.so"
|
||||
)
|
||||
\endcode
|
||||
If the policy is set to NEW for the above example, the resulting JSON string in
|
||||
the deployment settings file will contain escaped symbols instead of path
|
||||
separators.
|
||||
|
||||
Generator expressions are only supported if the policy is set to NEW, so the
|
||||
OLD behavior generates a malformed deployment settings file with the following
|
||||
code:
|
||||
\badcode
|
||||
set_target_properties(
|
||||
QT_ANDROID_EXTRA_PLUGINS "$<TARGET_FILE_DIR:MyPlugin>"
|
||||
)
|
||||
\endcode
|
||||
|
||||
This property value works as expected with both OLD and NEW policy values:
|
||||
\badcode
|
||||
set_target_properties(
|
||||
QT_ANDROID_EXTRA_PLUGINS "/path/to/MyPlugin.so"
|
||||
)
|
||||
\endcode
|
||||
|
||||
\qtpolicydeprecatedbehavior
|
||||
|
||||
\sa qt_policy, {Qt CMake policies}
|
||||
|
||||
*/
|
@ -58,8 +58,7 @@ You can set \c behavior to one of the following options:
|
||||
\li \c{OLD} to explicitly opt-out of it
|
||||
\endlist
|
||||
|
||||
\note The \c{OLD} behavior of a policy is deprecated, and may
|
||||
be removed in the future.
|
||||
\qtpolicydeprecatedbehavior
|
||||
|
||||
\sa qt_standard_project_setup
|
||||
|
||||
|
@ -353,7 +353,7 @@
|
||||
\section3 Java-Style Iterators
|
||||
\l{java-style-iterators}{Java-Style iterators} were introduced in Qt 4. Their API is modelled
|
||||
on Java's iterator classes.
|
||||
New code should should prefer \l{STL-Style Iterators}.
|
||||
New code should prefer \l{STL-Style Iterators}.
|
||||
|
||||
\section1 Qt containers compared with std containers
|
||||
|
||||
|
@ -3,7 +3,7 @@ On Android, some limitations apply when dealing with
|
||||
\list
|
||||
\li Access permissions might be needed by prompting the user through the
|
||||
\l QFileDialog which implements
|
||||
\l {Access documents and other files from shared storage}{Android's native file picker}.
|
||||
\l {Android: Access documents and other files from shared storage}{Android's native file picker}.
|
||||
\li Aim to follow the \l {Android: Scoped storage}{Scoped storage} guidelines,
|
||||
such as using app specific directories instead of other public external directories.
|
||||
For more information, also see
|
||||
|
@ -22,3 +22,15 @@ Returns -1 if \a \2 is not found.
|
||||
Returns the index position of the last occurrence of the \1 \a \2
|
||||
in this string, searching backward from index position \a from.
|
||||
//! [qstring-last-index-of]
|
||||
|
||||
//! [qstring-local-8-bit-equivalent]
|
||||
On Unix systems this is equivalent to \1().
|
||||
Note that on Apple systems this function does not take
|
||||
\c\l{https://developer.apple.com/documentation/foundation/nsstring/1410091-defaultcstringencoding?language=objc}
|
||||
{NSString.defaultCStringEncoding} or
|
||||
\c\l{https://developer.apple.com/documentation/corefoundation/1541720-cfstringgetsystemencoding?language=objc}
|
||||
{CFStringGetSystemEncoding()} into account, as these functions
|
||||
typically return the legacy "Western (Mac OS Roman)" encoding,
|
||||
which should not be used on modern Apple operating systems.
|
||||
On Windows the system's current code page is used.
|
||||
//! [qstring-local-8-bit-equivalent]
|
||||
|
489
src/corelib/doc/src/ipc.qdoc
Normal file
489
src/corelib/doc/src/ipc.qdoc
Normal file
@ -0,0 +1,489 @@
|
||||
// Copyright (C) 2022 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
/*!
|
||||
\page ipc.html
|
||||
\title Inter-Process Communication
|
||||
\ingroup groups
|
||||
\ingroup frameworks-technologies
|
||||
\keyword ipc
|
||||
\ingroup explanations-networkingandconnectivity
|
||||
|
||||
\brief An overview of Qt's inter-process communication functionality
|
||||
|
||||
Qt supports many ways of communicating with other processes running in the
|
||||
same system or in different systems. There are basically three types of
|
||||
inter-process communication mechanisms:
|
||||
|
||||
\list 1
|
||||
\li Synchronization primitives
|
||||
\li Exchanging of arbitrary byte-level data
|
||||
\li Passing structured messages
|
||||
\endlist
|
||||
|
||||
\section1 Synchronization primitives
|
||||
|
||||
Qt only provides one class for explicit inter-process synchronization:
|
||||
\l{QSystemSemaphore}. A QSystemSemaphore is like a \l{QSemaphore} that is
|
||||
accessible by multiple processes in the same system. It is globally
|
||||
identified by a "key", which in Qt is represented by the \l{QNativeIpcKey}
|
||||
class. Additionally, depending on the OS, Qt may support multiple different
|
||||
backends for sharing memory; see the \l{Native IPC Keys} documentation for
|
||||
more information and limitations.
|
||||
|
||||
It is possible to use regular thread-synchronization primitives such as
|
||||
mutexes, wait conditions, and read-write locks, located in memory that is
|
||||
shared between processes. Qt does not provide any class to support this,
|
||||
but applications can use low-level operations on certain operating systems.
|
||||
|
||||
Other Qt classes may be used to provide higher-level locking, like
|
||||
\l{QLockFile}, or by acquiring a unique, system-wide resource. Such
|
||||
techniques include \l{QTcpServer}{TCP} or \l{QUdpSocket}{UDP} ports or
|
||||
well-known names in \l{QDBusConnection::registerService}{D-Bus}.
|
||||
|
||||
\section1 Byte-level data sharing
|
||||
|
||||
Using byte-level data, applications can implement any communication
|
||||
protocol they may choose. Sharing of byte data can be stream-oriented
|
||||
(serialized) or can allow random access (a similar condition to
|
||||
QFileDevice::isSequential()).
|
||||
|
||||
For serial communication, Qt provides a number of different classes and
|
||||
even full modules:
|
||||
\list
|
||||
\li Pipes and FIFOs: \l QFile
|
||||
\li Child processes: \l QProcess
|
||||
\li Sockets: \l QTcpSocket, \l QUdpSocket (in \l{Qt Network})
|
||||
\li HTTP(S): \l QNetworkAccessManager (in \l{Qt Network}) and
|
||||
\l QHttpServer (in \l{Qt HTTP Server})
|
||||
\li CoAP(S): \l QCoapClient (in \l{Qt CoAP})
|
||||
\endlist
|
||||
|
||||
For random-access data sharing within the same system, Qt provides
|
||||
\l{QSharedMemory}. See the \l{Shared Memory} documentation for detailed
|
||||
information.
|
||||
|
||||
\section1 Structured message passing
|
||||
|
||||
Qt also provides a number of techniques to exchange structured messages
|
||||
with other processes. Applications can build on top of the byte-level
|
||||
solutions above, such as by using \l QJsonDocument or \l QXmlStreamReader /
|
||||
\l QXmlStreamWriter over HTTP to perform JSONRPC or XMLRPC, respectively,
|
||||
or \l QCborValue with QtCoAP.
|
||||
|
||||
Dedicated Qt modules for structured messages and remote procedure-calling
|
||||
include:
|
||||
\list
|
||||
\li \l{Qt D-Bus}
|
||||
\li \l{Qt Remote Objects}
|
||||
\li \l{Qt WebSockets}
|
||||
\endlist
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page shared-memory.html
|
||||
\title Shared Memory
|
||||
\keyword ipc
|
||||
\keyword shared memory
|
||||
|
||||
\brief Overview of the techniques for sharing memory between processes
|
||||
|
||||
Qt provides two techniques to share memory with other processes in the same
|
||||
system: \l{QSharedMemory} and memory-mapped files using \l{QFile}. Memory
|
||||
that is shared with other processes is often referred to as a "segment",
|
||||
and although it may have been implemented as specific segments on
|
||||
processors with segmented memory models in the past, this is not the case
|
||||
in any modern operating system. Shared memory segments are simply regions
|
||||
of memory that the operating system will ensure are available to all
|
||||
processes participating.
|
||||
|
||||
\note The address at which the segment is located in memory will almost
|
||||
always be different for each process that is participating in the sharing.
|
||||
Therefore, applications must take care to share only position-independent
|
||||
data, such as primitive C++ types or arrays of such types.
|
||||
|
||||
\section1 Sharing memory using QSharedMemory
|
||||
|
||||
QSharedMemory provides a simple API to create a shared memory segment of a
|
||||
given size or attach to one that was created by another process.
|
||||
Additionally, it provides a pair of methods to \l{QSharedMemory::}{lock}
|
||||
and \l{QSharedMemory::}{unlock} the whole segment, using an internal
|
||||
\l{QSystemSemaphore}.
|
||||
|
||||
Shared memory segments and system semaphores are globally identified in the
|
||||
system through a "key", which in Qt is represented by the \l{QNativeIpcKey}
|
||||
class. Additionally, depending on the OS, Qt may support multiple different
|
||||
backends for sharing memory; see the \l{Native IPC Keys} documentation for
|
||||
more information and limitations.
|
||||
|
||||
QSharedMemory is designed to share memory only within the same privilege
|
||||
level (that is, not with untrusted other processes, such as those started
|
||||
by other users). For backends that support it, QSharedMemory will create
|
||||
segments such that only processes with the same privilege level can attach.
|
||||
|
||||
\section1 Sharing memory via memory-mapped files
|
||||
|
||||
Most files can be mapped to memory using QFile::map() and, if the
|
||||
\l{QFileDevice::MapPrivateOption}{MapPrivateOption} option is not specified,
|
||||
any writes to the mapped segment will be observed by all other processes
|
||||
that have mapped the same file. Exceptions to files that can be mapped to
|
||||
memory include remote files found in network shares or those located in
|
||||
certain filesystems. Even if the operating system does allow mapping remote
|
||||
files to memory, I/O operations on the file will likely be cached and
|
||||
delayed, thus making true memory sharing impossible.
|
||||
|
||||
This solution has the major advantages of being independent of any backend
|
||||
API and of being simpler to interoperate with from non-Qt applications.
|
||||
Since \l{QTemporaryFile} is a \l{QFile}, applications can use that class to
|
||||
achieve clean-up semantics and to create unique shared memory segments too.
|
||||
|
||||
To achieve locking of the shared memory segment, applications will need to
|
||||
deploy their own mechanisms. One way may be to use \l QLockFile. Another
|
||||
and less costly solution is to use QBasicAtomicInteger or \c{std::atomic} in
|
||||
a pre-determined offset in the segment itself. Higher-level locking
|
||||
primitives may be available on some operating systems; for example, on
|
||||
Linux, applications can set the "pshared" flag in the mutex attribute
|
||||
passed to \c{pthread_mutex_create()} to indicate that the mutex resides in
|
||||
a shared memory segment.
|
||||
|
||||
Be aware that the operating system will likely attempt to commit to
|
||||
permanent storage any writes made to the shared memory. This may be desired
|
||||
or it may be a performance penalty if the file itself was meant to be
|
||||
temporary. In that case, applications should locate a RAM-backed
|
||||
filesystem, such as \c{tmpfs} on Linux (see
|
||||
QStorageInfo::fileSystemType()), or pass a flag to the native file-opening
|
||||
function to inform the OS to avoid committing the contents to storage.
|
||||
|
||||
It is possible to use file-backed shared memory to communicate with
|
||||
untrusted processes, in which case the application should exercise great
|
||||
care. The files may be truncated/shrunk and cause applications accessing
|
||||
memory beyond the file's size to crash.
|
||||
|
||||
\section2 Linux hints on memory-mapped files
|
||||
|
||||
On modern Linux systems, while the \c{/tmp} directory is often a \c{tmpfs}
|
||||
mount point, that is not a requirement. However, the \c{/dev/shm} directory
|
||||
is required to be a \c{tmpfs} and exists for the very purpose of sharing
|
||||
memory. Do note that it is world-readable and writable (like \c{/tmp} and
|
||||
\c{/var/tmp}), so applications must be careful of the contents revealed
|
||||
there. Another alternative is to use the XDG Runtime Directory (see
|
||||
QStandardPaths::writableLocation() and \l{QStandardPaths::RuntimeLocation}),
|
||||
which on Linux systems using systemd is a user-specific \c{tmpfs}.
|
||||
|
||||
An even more secure solution is to create a "memfd" using \c{memfd_create(2)}
|
||||
and use interprocess communication to pass the file descriptor, like
|
||||
\l{QDBusUnixFileDescriptor} or by letting the child process of a \l{QProcess}
|
||||
inherit it. "memfds" can also be sealed against being shrunk, so they are
|
||||
safe to be used when communicating with processes with a different privilege
|
||||
level.
|
||||
|
||||
\section2 FreeBSD hints on memory-mapped files
|
||||
|
||||
FreeBSD also has \c{memfd_create(2)} and can pass file descriptors to other
|
||||
processes using the same techniques as Linux. It does not have temporary
|
||||
filesystems mounted by default.
|
||||
|
||||
\section2 Windows hints on memory-mapped files
|
||||
|
||||
On Windows, the application can request the operating system avoid saving
|
||||
the file's contents on permanent storage. This request is performed by
|
||||
passing the \c{FILE_ATTRIBUTE_TEMPORARY} flag in the
|
||||
\c{dwFlagsAndAttributes} parameter to the \c{CreateFile} Win32 function,
|
||||
the \c{_O_SHORT_LIVED} flag to \c{_open()} low-level function, or by
|
||||
including the modifier "T" to the
|
||||
\c{fopen()} C runtime function.
|
||||
|
||||
There's also a flag to inform the operating system to delete the file when
|
||||
the last handle to it is closed (\c{FILE_FLAG_DELETE_ON_CLOSE},
|
||||
\c{_O_TEMPORARY}, and the "D" modifier), but do note that all processes
|
||||
attempting to open the file must agree on using this flag or not using it. A
|
||||
mismatch will likely cause a sharing violation and failure to open the file.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page native-ipc-keys.html
|
||||
\title Native IPC Keys
|
||||
\keyword ipc
|
||||
\keyword shared memory
|
||||
\keyword system semaphore
|
||||
|
||||
\brief An overview of keys for QSharedMemory and QSystemSemaphore
|
||||
|
||||
The \l QSharedMemory and \l QSystemSemaphore classes identify their
|
||||
resource using a system-wide identifier known as a "key". The low-level key
|
||||
value as well as the key type are encapsulated in Qt using the \l
|
||||
QNativeIpcKey class. That class also provides the proper means of
|
||||
exchanging the key with other processes, by way of
|
||||
QNativeIpcKey::toString() and QNativeIpcKey::fromString().
|
||||
|
||||
Qt currently supports three distinct backends for those two classes, which
|
||||
match the values available in the \l{QNativeIpcKey::Type} enumeration.
|
||||
\list
|
||||
\li POSIX Realtime extensions (IEEE 1003.1b, POSIX.1b)
|
||||
\li X/Open System Interfaces (XSI) or System V (SVr4), though also now part of POSIX
|
||||
\li Windows primitives
|
||||
\endlist
|
||||
|
||||
As the name indicates, the Windows primitives are only available on the
|
||||
Windows operating system, where they are the default backend. The other two
|
||||
are usually both available on Unix operating systems. The following table
|
||||
provides an overview of typical availability since Qt 6.6:
|
||||
|
||||
\table
|
||||
\header \li Operating system \li POSIX \li System V \li Windows
|
||||
\row \li Android \li \li \li
|
||||
\row \li INTEGRITY \li \li \li
|
||||
\row \li QNX \li Yes \li \li
|
||||
\row \li \macos \li Yes \li Usually (1) \li
|
||||
\row \li Other Apple OSes \li Yes \li \li
|
||||
\row \li Other Unix systems \li Yes \li Yes \li
|
||||
\row \li Windows \li Rarely (2) \li \li Yes
|
||||
\endtable
|
||||
|
||||
\note 1 Sandboxed \macos applications, which include all applications
|
||||
distributed via the Apple App Store, may not use System V objects.
|
||||
|
||||
\note 2 Some GCC-compatible C runtimes on Windows provide POSIX-compatible
|
||||
shared memory support, but this is rare. It is always absent with the
|
||||
Microsoft compiler.
|
||||
|
||||
To determine whether a given key type is supported, applications should
|
||||
call QSharedMemory::isKeyTypeSupported() and
|
||||
QSystemSemaphore::isKeyTypeSupported().
|
||||
|
||||
QNativeIpcKey also provides support for compatibility with Qt applications
|
||||
prior to its introduction. The following sections detail the limitations of
|
||||
the backends, the contents of the string keys themselves, and
|
||||
compatibility.
|
||||
|
||||
\section1 Cross-platform safe key format
|
||||
|
||||
QNativeIpcKey::setNativeKey() and QNativeIpcKey::nativeKey() handle the
|
||||
low-level native key, which may be used with the native APIs and shared
|
||||
with other, non-Qt processes (see below for the API). This format is not
|
||||
usually cross-platform, so both QSharedMemory and QSystemSemaphore provide
|
||||
a function to translate a cross-platform identifier string to the native
|
||||
key: QSharedMemory::platformSafeKey() and
|
||||
QSystemSemaphore::platformSafeKey().
|
||||
|
||||
The length of the cross-platform key on most platforms is the same as that
|
||||
of a file name, but is severely limited on Apple platforms to only 30
|
||||
usable bytes (be mindful of UTF-8 encoding if using characters outside the
|
||||
US-ASCII range). The format of the key is also similar to that of a file
|
||||
path component, meaning it should not contain any characters not allowed in
|
||||
file names, in particular those that separate path components (slash and
|
||||
backslash), with the exception of sandboxed applications on Apple operating
|
||||
systems. The following are good examples of cross-platform keys: "myapp",
|
||||
"org.example.myapp", "org.example.myapp-12345".
|
||||
|
||||
\b{Apple sandbox limitations:} if the application is running inside of a
|
||||
sandbox in an Apple operating system, the key must be in a very specific
|
||||
format: \c {<application group identifier>/<custom identifier>}. Sandboxing
|
||||
is implied for all applications distributed through the Apple App Store.
|
||||
See Apple's documentation
|
||||
\l{https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24}
|
||||
{here} and \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_application-groups}
|
||||
{here} for more information, including how to obtain the application's group identifier.
|
||||
|
||||
\section1 Native key format
|
||||
|
||||
This section details the format of the native keys of the supported
|
||||
backends.
|
||||
|
||||
\section3 POSIX Realtime
|
||||
Native keys resemble file names and may contain any character that file
|
||||
names do, except for a slash. POSIX requires the first character in the key
|
||||
name to be a slash and leaves undetermined whether any additional slashes
|
||||
are permitted. On most operating systems, the key length is the same as a
|
||||
file name, but it is limited to 32 characters on Apple operating systems
|
||||
(this includes the first slash and the terminating null, so only 30 usable
|
||||
characters are possible).
|
||||
|
||||
The following are good examples of native POSIX keys: "/myapp",
|
||||
"/org.example.myapp", "/org.example.myapp-12345".
|
||||
|
||||
QSharedMemory::platformSafeKey() and QSystemSemaphore::platformSafeKey()
|
||||
simply prepend the slash. On Apple operating systems, they also truncate
|
||||
the result to the available size.
|
||||
|
||||
\section3 Windows
|
||||
Windows key types are NT
|
||||
\l{https://learn.microsoft.com/en-us/windows/win32/sync/object-namespaces}{kernel
|
||||
object names} and may be up to \c{MAX_PATH} (260) characters in length.
|
||||
They look like relative paths (that is, they don't start with a backslash
|
||||
or a drive letter), but unlike file names on Windows, they are
|
||||
case-sensitive.
|
||||
|
||||
The following are good examples of native Windows keys: "myapp",
|
||||
"org.example.myapp", "org.example.myapp-12345".
|
||||
|
||||
QSharedMemory::platformSafeKey() and QSystemSemaphore::platformSafeKey()
|
||||
insert a prefix to disambiguate shared memory and system semaphores,
|
||||
respectively.
|
||||
|
||||
\section3 X/Open System Interfaces (XSI) / System V
|
||||
System V keys take the form of the name of a file in the system, and thus
|
||||
have the exact same limitations as file paths do. Both QSharedMemory and
|
||||
QSystemSemaphore will create this file if it does not exist when creating
|
||||
the object. If auto-removal is disabled, it may also be shared between
|
||||
QSharedMemory and QSystemSemaphore without conflict and can be any extant
|
||||
file (for example, it can be the process executable itself, see
|
||||
QCoreApplication::applicationFilePath()). The path should be an absolute
|
||||
one to avoid mistakes due to different current directories.
|
||||
|
||||
QSharedMemory::platformSafeKey() and QSystemSemaphore::platformSafeKey()
|
||||
always return an absolute path. If the input was already absolute, they
|
||||
will return their input unchanged. Otherwise, they will prepend a suitable
|
||||
path where the application usually has permission to create files in.
|
||||
|
||||
\section1 Ownership
|
||||
|
||||
Shared memory and system semaphore objects need to be created before use,
|
||||
which is accomplished with QSharedMemory::create() or by passing
|
||||
QSystemSemaphore::Create to the constructor, respectively.
|
||||
|
||||
On Unix systems, the Qt classes that created the object will be responsible
|
||||
for cleaning up the object in question. Therefore, if the application with
|
||||
that C++ object exits uncleanly (a crash, qFatal(), etc.), the object may
|
||||
be left behind. If that happens, applications may fail to create the
|
||||
object again and should instead attach to an existing one. For example, for
|
||||
QSharedMemory:
|
||||
|
||||
\code
|
||||
if (!shm.create(4096) && shm.error() == QSharedMemory::AlreadyExists)
|
||||
shm.attach();
|
||||
\endcode
|
||||
|
||||
Re-attaching to a QSystemSemaphore is probably unwise, as the token counter
|
||||
in it is probably in an unknown state and therefore may lead to deadlocks.
|
||||
|
||||
\section3 POSIX Realtime
|
||||
POSIX Realtime object ownership is patterned after files, in the sense that
|
||||
they exist independent of any process using them or not. Qt is unable to
|
||||
determine if the object is still in use, so auto-removal will remove it
|
||||
even then, which will make attaching to the same object impossible but
|
||||
otherwise not affecting existing attachments.
|
||||
|
||||
Prior to Qt 6.6, Qt never cleaned up POSIX Realtime objects, except on QNX.
|
||||
|
||||
\section3 X/Open System Interfaces (XSI) / System V
|
||||
There are two resources managed by the Qt classes: the file the key refers
|
||||
to and the object itself. QSharedMemory manages the object cooperatively:
|
||||
the last attachment is responsible for removing the object itself and then
|
||||
removing the key file. QSystemSemaphore will remove the object if and only
|
||||
if it was passed QSystemSemaphore::Create; additionally, if it created the
|
||||
key file, it will remove that too.
|
||||
|
||||
Since Qt 6.6, it is possible to ask either class not to clean up.
|
||||
|
||||
\section3 Windows
|
||||
The operating system owns the object and will clean up after the last
|
||||
handle to the object is closed.
|
||||
|
||||
\section1 Interoperability with old Qt applications
|
||||
|
||||
The QNativeIpcKey class was introduced in Qt 6.6. Prior to this version,
|
||||
QSharedMemory and QSystemSemaphore backends were determined at the time of
|
||||
Qt's own build. For Windows systems, it was always the Windows backend. For
|
||||
Unix systems, it defaulted to the System V backend if the configuration
|
||||
script determined it was available. If it was not available, it fell back
|
||||
to the POSIX one (since Qt 4.8). The POSIX backend could be explicitly
|
||||
selected using the \c{-feature-ipc_posix} option to the Qt configure
|
||||
script; if it was enabled, the \c{QT_POSIX_IPC} macro would be defined.
|
||||
|
||||
Qt 6.6 retains the configure script option but it no longer controls the
|
||||
availability of the backends. Instead, it changes what
|
||||
QNativeIpcKey::legacyDefaultTypeForOs() will return. Applications that need
|
||||
to retain compatibility must use this key type exclusively to guarantee
|
||||
interoperability.
|
||||
|
||||
The API in both QSharedMemory and QSystemSemaphore had the concept of a
|
||||
cross-platform key, which is now deprecated in favor of using
|
||||
QSharedMemory::legacyNativeKey() and QSystemSemaphore::legacyNativeKey().
|
||||
Those two functions produce the same native key as the deprecated functions
|
||||
did in prior versions. If the old code was for example:
|
||||
|
||||
\code
|
||||
QSharedMemory shm("org.example.myapplication");
|
||||
QSystemSemaphore sem("org.example.myapplication");
|
||||
\endcode
|
||||
|
||||
It can be updated to be:
|
||||
\code
|
||||
QSharedMemory shm(QSharedMemory::legacyNativeKey("org.example.myapplication"));
|
||||
QSystemSemaphore sem(QSystemSemaphore::legacyNativeKey("org.example.myapplication"));
|
||||
\endcode
|
||||
|
||||
If the two applications exchanged native keys, there is no need to update
|
||||
code such as:
|
||||
|
||||
\code
|
||||
QSharedMemory shm;
|
||||
shm.setNativeKey(key);
|
||||
\endcode
|
||||
|
||||
Though if the older application did accept a native key, the new one may
|
||||
opt to use \c{platformSafeKey()} with a second argument of
|
||||
QNativeIpcKey::legacyDefaultTypeForOs().
|
||||
|
||||
\section3 X/Open System Interfaces (XSI) / System V
|
||||
Never use existing files for QSharedMemory keys, as the old Qt application
|
||||
may attempt to remove it. Instead, let QSharedMemory create it.
|
||||
|
||||
\section1 Interoperability with non-Qt applications
|
||||
|
||||
Interoperability with non-Qt applications is possible, with some limitations:
|
||||
\list
|
||||
\li Creation of shared memory segments must not race
|
||||
\li QSharedMemory support for locking the segment is unavailable
|
||||
\endlist
|
||||
|
||||
Communication with non-Qt applications must always be through the native
|
||||
key.
|
||||
|
||||
QSharedMemory always maps the entire segment to memory. The non-Qt
|
||||
application may choose to only map a subset of it to memory, with no ill
|
||||
effects.
|
||||
|
||||
\section3 POSIX Realtime
|
||||
POSIX shared memory can be opened using
|
||||
\l{https://pubs.opengroup.org/onlinepubs/9699919799/functions/shm_open.html}{shm_open()}
|
||||
and POSIX system semaphores can be opened using
|
||||
\l{https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_open.html}{sem_open()}.
|
||||
|
||||
Both of those functions take a \c name parameter that is the result of
|
||||
QNativeIpcKey::nativeKey(), encoded for file names using
|
||||
QFile::encodeName() / QFile::decodeName().
|
||||
|
||||
\section3 Windows
|
||||
Windows shared memory objects can be opened using
|
||||
\l{https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-createfilemappingw}{CreateFileMappingW}
|
||||
and Windows system semaphore objects can be opened using
|
||||
\l{https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createsemaphorew}{CreateSemaphoreW}.
|
||||
Despite the name of both functions starting with "Create", they are able
|
||||
to attach to existing objects.
|
||||
|
||||
The \c lpName parameter to those functions is the result of
|
||||
QNativeIpcKey::nativeKey(), without transformation.
|
||||
|
||||
If the foreign application uses the non-Unicode version of those functions
|
||||
(ending in "A"), the name can be converted to and from 8-bit using QString.
|
||||
|
||||
\section3 X/Open System Interfaces (XSI) / System V
|
||||
System V shared memory can be obtained using
|
||||
\l{https://pubs.opengroup.org/onlinepubs/9699919799/functions/shmget.html}{shmget()}
|
||||
and System V system semaphores can be obtained using
|
||||
\l{https://pubs.opengroup.org/onlinepubs/9699919799/functions/semget.html}{semget()}.
|
||||
|
||||
The \c{key} parameter to either of those functions is the result of the
|
||||
\l{https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftok.html}{ftok()}
|
||||
function when passed the file name obtained from QNativeIpcKey::nativeKey()
|
||||
with an \c id of 81 or 0x51 (the ASCII capital letter 'Q').
|
||||
|
||||
System V semaphore objects may contain multiple semaphores, but
|
||||
QSystemSemaphore only uses the first one (number 0 for \c{sem_num}).
|
||||
|
||||
Both QSharedMemory and QSystemSemaphore default to removing the object
|
||||
using the \c{IPC_RMID} operation to \c{shmctl()} and \c{semctl()}
|
||||
respectively if they are the last attachment.
|
||||
*/
|
@ -6,7 +6,7 @@
|
||||
\title JSON Support in Qt
|
||||
\ingroup qt-basic-concepts
|
||||
\brief An overview of JSON support in Qt.
|
||||
|
||||
\ingroup explanations-dataprocessingandio
|
||||
\ingroup frameworks-technologies
|
||||
|
||||
\keyword JSON
|
||||
|
@ -5,7 +5,7 @@
|
||||
\page metaobjects.html
|
||||
\title The Meta-Object System
|
||||
\brief An overview of Qt's meta-object system and introspection capabilities.
|
||||
|
||||
\ingroup explanations-basics
|
||||
\ingroup qt-basic-concepts
|
||||
\keyword meta-object
|
||||
\keyword Meta-Object System
|
||||
|
@ -5,7 +5,7 @@
|
||||
\page properties.html
|
||||
\title The Property System
|
||||
\brief An overview of Qt's property system.
|
||||
|
||||
\ingroup explanations-basics
|
||||
\ingroup qt-basic-concepts
|
||||
\keyword Qt's Property System
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
\ingroup qt-basic-concepts
|
||||
\brief An overview of Qt's signals and slots inter-object
|
||||
communication mechanism.
|
||||
|
||||
\ingroup explanations-basics
|
||||
Signals and slots are used for communication between objects. The
|
||||
signals and slots mechanism is a central feature of Qt and
|
||||
probably the part that differs most from the features provided by
|
||||
|
@ -76,6 +76,7 @@
|
||||
\li \l{The Animation Framework}
|
||||
\li \l{JSON Support in Qt}
|
||||
\li \l{CBOR Support in Qt}
|
||||
\li \l{Inter-Process Communication}
|
||||
\li \l{How to Create Qt Plugins}
|
||||
\li \l{The Event System}
|
||||
\li \l{Application Permissions}
|
||||
|
@ -160,6 +160,25 @@
|
||||
The file is from the application then only accessible as \c :/cut-img.png
|
||||
or \c{qrc:/cut-img.png}.
|
||||
|
||||
\section2 Discarding the file contents
|
||||
|
||||
Sometimes you want to add a file node to the resource file system but
|
||||
don't actually want to add the file contents. \c .qrc files allow this
|
||||
by setting the \c empty attribute to \c{true}.
|
||||
|
||||
\snippet code/doc_src_resources.qdoc 4
|
||||
|
||||
The resulting file is then still accessible from the application, but
|
||||
its contents are empty.
|
||||
|
||||
This is useful to strip QML source code from an application binary.
|
||||
|
||||
\note If you omit the QML source code from the binary, the QML engine has to
|
||||
rely on the compilation units created by \l{qmlcachegen} or \l{qmlsc}.
|
||||
Those are tied to the specific version of Qt they were built with. If you
|
||||
change the version of Qt your application uses, they can't be loaded
|
||||
anymore.
|
||||
|
||||
\section2 Language Selectors
|
||||
|
||||
Some resources need to change based on the user's locale, such as
|
||||
|
62
src/corelib/global/q20chrono.h
Normal file
62
src/corelib/global/q20chrono.h
Normal file
@ -0,0 +1,62 @@
|
||||
// Copyright (C) 2023 Ahmad Samir <a.samirh78@gmail.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#ifndef Q20CHRONO_H
|
||||
#define Q20CHRONO_H
|
||||
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. Types and functions defined in this
|
||||
// file can reliably be replaced by their std counterparts, once available.
|
||||
// You may use these definitions in your own code, but be aware that we
|
||||
// will remove them once Qt depends on the C++ version that supports
|
||||
// them in namespace std. There will be NO deprecation warning, the
|
||||
// definitions will JUST go away.
|
||||
//
|
||||
// If you can't agree to these terms, don't use these definitions!
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace q20 {
|
||||
namespace chrono {
|
||||
|
||||
#if defined(__GLIBCXX__)
|
||||
// https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/include/bits/chrono.h
|
||||
using IntRep = int64_t;
|
||||
#else
|
||||
// https://github.com/llvm/llvm-project/blob/main/libcxx/include/__chrono/duration.h
|
||||
// https://github.com/microsoft/STL/blob/main/stl/inc/__msvc_chrono.hpp
|
||||
using IntRep = int;
|
||||
#endif
|
||||
|
||||
#if __cpp_lib_chrono >= 201907L
|
||||
using std::chrono::days;
|
||||
using std::chrono::weeks;
|
||||
using std::chrono::years;
|
||||
using std::chrono::months;
|
||||
|
||||
static_assert(std::is_same_v<days::rep, IntRep>);
|
||||
static_assert(std::is_same_v<weeks::rep, IntRep>);
|
||||
static_assert(std::is_same_v<years::rep, IntRep>);
|
||||
static_assert(std::is_same_v<months::rep, IntRep>);
|
||||
#else // __cpp_lib_chrono >= 201907L
|
||||
using days = std::chrono::duration<IntRep, std::ratio<86400>>;
|
||||
using weeks = std::chrono::duration<IntRep, std::ratio_multiply<std::ratio<7>, days::period>>;
|
||||
using years = std::chrono::duration<IntRep, std::ratio_multiply<std::ratio<146097, 400>, days::period>>;
|
||||
using months = std::chrono::duration<IntRep, std::ratio_divide<years::period, std::ratio<12>>>;
|
||||
#endif // __cpp_lib_chrono >= 201907L
|
||||
} // namespace chrono
|
||||
} // namespace q20
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif /* Q20CHRONO_H */
|
@ -39,6 +39,16 @@ namespace q20 {
|
||||
#endif
|
||||
} // namespace q20
|
||||
|
||||
// like q20::iter_reference_t
|
||||
namespace q20 {
|
||||
#ifdef __cpp_lib_ranges
|
||||
using std::iter_reference_t;
|
||||
#else
|
||||
template <typename Dereferencable> // unconstrained (constraint requires concepts)
|
||||
using iter_reference_t = decltype(*std::declval<Dereferencable&>());
|
||||
#endif // __cpp_lib_ranges
|
||||
} // namespace q20
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif /* Q20ITERATOR_H */
|
||||
|
@ -1,4 +1,5 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#ifndef Q20MEMORY_H
|
||||
@ -7,9 +8,9 @@
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
@ -45,6 +46,48 @@ T *construct_at(T *ptr, Args && ... args)
|
||||
#endif // __cpp_lib_constexpr_dynamic_alloc
|
||||
} // namespace q20
|
||||
|
||||
|
||||
namespace q20 {
|
||||
// like std::to_address
|
||||
#ifdef __cpp_lib_to_address
|
||||
using std::to_address;
|
||||
#else
|
||||
// http://eel.is/c++draft/pointer.conversion
|
||||
template <typename T>
|
||||
constexpr T *to_address(T *p) noexcept {
|
||||
// http://eel.is/c++draft/pointer.conversion#1:
|
||||
// Mandates: T is not a function type.
|
||||
static_assert(!std::is_function_v<T>, "to_address must not be used on function types");
|
||||
return p;
|
||||
}
|
||||
|
||||
template <typename Ptr, typename std::enable_if_t<!std::is_pointer_v<Ptr>, bool> = true>
|
||||
constexpr auto to_address(const Ptr &ptr) noexcept; // fwd declared
|
||||
|
||||
namespace detail {
|
||||
// http://eel.is/c++draft/pointer.conversion#3
|
||||
template <typename Ptr, typename = void>
|
||||
struct to_address_helper {
|
||||
static auto get(const Ptr &ptr) noexcept
|
||||
{ return q20::to_address(ptr.operator->()); }
|
||||
};
|
||||
template <typename Ptr>
|
||||
struct to_address_helper<Ptr, std::void_t<
|
||||
decltype(std::pointer_traits<Ptr>::to_address(std::declval<const Ptr&>()))
|
||||
>>
|
||||
{
|
||||
static auto get(const Ptr &ptr) noexcept
|
||||
{ return std::pointer_traits<Ptr>::to_address(ptr); }
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
template <typename Ptr, typename std::enable_if_t<!std::is_pointer_v<Ptr>, bool>>
|
||||
constexpr auto to_address(const Ptr &ptr) noexcept
|
||||
{ return detail::to_address_helper<Ptr>::get(ptr); }
|
||||
|
||||
#endif // __cpp_lib_to_address
|
||||
} // namespace q20
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif /* Q20MEMORY_H */
|
||||
|
@ -38,6 +38,19 @@ using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
|
||||
#endif // __cpp_lib_remove_cvref
|
||||
}
|
||||
|
||||
namespace q20 {
|
||||
// like std::type_identity(_t)
|
||||
#ifdef __cpp_lib_type_identity
|
||||
using std::type_identity;
|
||||
using std::type_identity_t;
|
||||
#else
|
||||
template <typename T>
|
||||
struct type_identity { using type = T; };
|
||||
template <typename T>
|
||||
using type_identity_t = typename type_identity<T>::type;
|
||||
#endif // __cpp_lib_type_identity
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif /* Q20TYPE_TRAITS_H */
|
||||
|
25
src/corelib/global/q23utility.cpp
Normal file
25
src/corelib/global/q23utility.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#include <QtCore/q23utility.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#define CHECK2(cvref_in, cvref_out) \
|
||||
static_assert(std::is_same_v< \
|
||||
decltype(q23::forward_like<int cvref_in >(std::declval<long&>())), \
|
||||
long cvref_out \
|
||||
>, "oops: cvref '" #cvref_in "' doesn't work") \
|
||||
/* end */
|
||||
#define CHECK(cvref) CHECK2(cvref, cvref)
|
||||
CHECK2(/**/, &&);
|
||||
CHECK(&);
|
||||
CHECK(&&);
|
||||
CHECK2(const, const &&);
|
||||
CHECK(const &);
|
||||
CHECK(const &&);
|
||||
// volatile is not supported
|
||||
#undef CHECK
|
||||
#undef CHECK2
|
||||
|
||||
QT_END_NAMESPACE
|
75
src/corelib/global/q23utility.h
Normal file
75
src/corelib/global/q23utility.h
Normal file
@ -0,0 +1,75 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
#ifndef Q23UTILITY_H
|
||||
#define Q23UTILITY_H
|
||||
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. Types and functions defined in this
|
||||
// file can reliably be replaced by their std counterparts, once available.
|
||||
// You may use these definitions in your own code, but be aware that we
|
||||
// will remove them once Qt depends on the C++ version that supports
|
||||
// them in namespace std. There will be NO deprecation warning, the
|
||||
// definitions will JUST go away.
|
||||
//
|
||||
// If you can't agree to these terms, don't use these definitions!
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace q23 {
|
||||
// like std::forward_like
|
||||
#ifdef __cpp_lib_forward_like
|
||||
using std::forward_like;
|
||||
#else
|
||||
|
||||
namespace _detail {
|
||||
|
||||
// [forward]/6.1 COPY_CONST
|
||||
template <typename A, typename B>
|
||||
using copy_const_t = std::conditional_t<
|
||||
std::is_const_v<A>, const B,
|
||||
/* else */ B
|
||||
>;
|
||||
|
||||
// [forward]/6.2 OVERRIDE_REF
|
||||
template <typename A, typename B>
|
||||
using override_ref_t = std::conditional_t<
|
||||
std::is_rvalue_reference_v<A>, std::remove_reference_t<B>&&,
|
||||
/* else */ B&
|
||||
>;
|
||||
|
||||
// [forward]/6.3 "V"
|
||||
template <typename T, typename U>
|
||||
using forward_like_ret_t = override_ref_t<
|
||||
T&&,
|
||||
copy_const_t<
|
||||
std::remove_reference_t<T>,
|
||||
std::remove_reference_t<U>
|
||||
>
|
||||
>;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// http://eel.is/c++draft/forward#lib:forward_like
|
||||
template <class T, class U>
|
||||
[[nodiscard]] constexpr auto forward_like(U &&x) noexcept
|
||||
-> _detail::forward_like_ret_t<T, U>
|
||||
{
|
||||
using V = _detail::forward_like_ret_t<T, U>;
|
||||
return static_cast<V>(x);
|
||||
}
|
||||
#endif // __cpp_lib_forward_like
|
||||
} // namespace q23
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif /* Q23UTILITY_H */
|
@ -139,29 +139,20 @@ void qBadAlloc()
|
||||
|
||||
/*!
|
||||
\macro void Q_ASSUME(bool expr)
|
||||
\deprecated
|
||||
\relates <QtAssert>
|
||||
\since 5.0
|
||||
|
||||
Causes the compiler to assume that \a expr is \c true. This macro is useful
|
||||
for improving code generation, by providing the compiler with hints about
|
||||
conditions that it would not otherwise know about. However, there is no
|
||||
guarantee that the compiler will actually use those hints.
|
||||
Causes the compiler to assume that \a expr is \c true.
|
||||
|
||||
This macro could be considered a "lighter" version of \l{Q_ASSERT()}. While
|
||||
Q_ASSERT will abort the program's execution if the condition is \c false,
|
||||
Q_ASSUME will tell the compiler not to generate code for those conditions.
|
||||
Therefore, it is important that the assumptions always hold, otherwise
|
||||
undefined behavior may occur.
|
||||
This macro is known to produce worse code than when no assumption was
|
||||
inserted in the code, with some compiler versions. The arguments passed to
|
||||
it are always evaluated, even in release mode, with some compilers and not
|
||||
others, so application code needs to be aware of those possible differences
|
||||
in behavior.
|
||||
|
||||
If \a expr is a constantly \c false condition, Q_ASSUME will tell the compiler
|
||||
that the current code execution cannot be reached. That is, Q_ASSUME(false)
|
||||
is equivalent to Q_UNREACHABLE().
|
||||
|
||||
In debug builds the condition is enforced by an assert to facilitate debugging.
|
||||
|
||||
\note Q_LIKELY() tells the compiler that the expression is likely, but not
|
||||
the only possibility. Q_ASSUME tells the compiler that it is the only
|
||||
possibility.
|
||||
Do not use it in new code. It is retained as-is for compatibility with old
|
||||
code and will likely be removed in the next major version Qt.
|
||||
|
||||
\sa Q_ASSERT(), Q_UNREACHABLE(), Q_LIKELY()
|
||||
*/
|
||||
@ -199,7 +190,7 @@ void qBadAlloc()
|
||||
compilers that need them, without causing warnings for compilers that
|
||||
complain about its presence.
|
||||
|
||||
\sa Q_ASSERT(), Q_ASSUME(), qFatal(), Q_UNREACHABLE_RETURN()
|
||||
\sa Q_ASSERT(), qFatal(), Q_UNREACHABLE_RETURN()
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <QtCore/qcompilerdetection.h>
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qtcoreexports.h>
|
||||
#include <QtCore/qtnoop.h>
|
||||
|
||||
#if 0
|
||||
#pragma qt_class(QtAssert)
|
||||
@ -17,7 +18,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
#ifndef Q_CC_MSVC
|
||||
#if !defined(Q_CC_MSVC_ONLY)
|
||||
Q_NORETURN
|
||||
#endif
|
||||
Q_DECL_COLD_FUNCTION
|
||||
@ -31,7 +32,7 @@ Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef Q_CC_MSVC
|
||||
#if !defined(Q_CC_MSVC_ONLY)
|
||||
Q_NORETURN
|
||||
#endif
|
||||
Q_DECL_COLD_FUNCTION
|
||||
|
@ -1,15 +1,16 @@
|
||||
// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#ifndef QCOMPARE_IMPL_H
|
||||
#define QCOMPARE_IMPL_H
|
||||
|
||||
#if 0
|
||||
#pragma qt_sync_skip_header_check
|
||||
#pragma qt_sync_stop_processing
|
||||
#endif
|
||||
|
||||
#ifndef QCOMPARE_IMPL_H
|
||||
#define QCOMPARE_IMPL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qcompilerdetection.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -2,9 +2,7 @@
|
||||
// Copyright (C) 2016 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#ifndef QGLOBAL_H
|
||||
# include <QtCore/qglobal.h>
|
||||
#endif
|
||||
#include <QtCore/qsystemdetection.h>
|
||||
|
||||
#if 0
|
||||
#pragma qt_class(QtCompilerDetection)
|
||||
@ -179,7 +177,7 @@
|
||||
# ifdef Q_OS_WIN
|
||||
# define Q_DECL_EXPORT __declspec(dllexport)
|
||||
# define Q_DECL_IMPORT __declspec(dllimport)
|
||||
# elif defined(QT_VISIBILITY_AVAILABLE)
|
||||
# else
|
||||
# define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak))
|
||||
# ifdef QT_USE_PROTECTED_VISIBILITY
|
||||
# define Q_DECL_EXPORT __attribute__((visibility("protected")))
|
||||
@ -513,8 +511,7 @@
|
||||
* For library features, we assume <version> is present (this header includes it).
|
||||
*
|
||||
* For a full listing of feature test macros, see
|
||||
* https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations (by macro)
|
||||
* https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros (by C++ version)
|
||||
* https://en.cppreference.com/w/cpp/feature_test
|
||||
*
|
||||
* C++ extensions:
|
||||
* Q_COMPILER_RESTRICTED_VLA variable-length arrays, prior to __cpp_runtime_arrays
|
||||
@ -548,7 +545,8 @@
|
||||
# endif
|
||||
|
||||
/* C++11 features, see http://clang.llvm.org/cxx_status.html */
|
||||
# if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
# if (defined(__cplusplus) && __cplusplus >= 201103L) \
|
||||
|| defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
/* Detect C++ features using __has_feature(), see http://clang.llvm.org/docs/LanguageExtensions.html#cxx11 */
|
||||
# if __has_feature(cxx_alignas)
|
||||
# define Q_COMPILER_ALIGNAS
|
||||
@ -646,10 +644,10 @@
|
||||
# if Q_CC_CLANG >= 209 /* since clang 2.9 */
|
||||
# define Q_COMPILER_EXTERN_TEMPLATES
|
||||
# endif
|
||||
# endif
|
||||
# endif // (defined(__cplusplus) && __cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
|
||||
/* C++1y features, deprecated macros. Do not update this list. */
|
||||
# if __cplusplus > 201103L
|
||||
# if defined(__cplusplus) && __cplusplus > 201103L
|
||||
//# if __has_feature(cxx_binary_literals)
|
||||
//# define Q_COMPILER_BINARY_LITERALS // see above
|
||||
//# endif
|
||||
@ -671,7 +669,7 @@
|
||||
# if __has_feature(cxx_runtime_array)
|
||||
# define Q_COMPILER_VLA
|
||||
# endif
|
||||
# endif
|
||||
# endif // if defined(__cplusplus) && __cplusplus > 201103L
|
||||
|
||||
# if defined(__STDC_VERSION__)
|
||||
# if __has_feature(c_static_assert)
|
||||
@ -895,7 +893,7 @@
|
||||
# endif // !_HAS_CONSTEXPR
|
||||
# endif // !__GLIBCXX__ && !_LIBCPP_VERSION
|
||||
# endif // Q_OS_QNX
|
||||
# if defined(Q_CC_CLANG) && defined(Q_OS_MAC)
|
||||
# if defined(Q_CC_CLANG) && defined(Q_OS_DARWIN)
|
||||
# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
|
||||
// Apple has not updated libstdc++ since 2007, which means it does not have
|
||||
// <initializer_list> or std::move. Let's disable these features
|
||||
@ -956,6 +954,13 @@
|
||||
# define Q_REQUIRED_RESULT [[nodiscard]]
|
||||
#endif
|
||||
|
||||
#if __has_cpp_attribute(nodiscard) >= 201907L /* used for both P1771 and P1301... */
|
||||
// [[nodiscard]] constructor (P1771)
|
||||
# ifndef Q_NODISCARD_CTOR
|
||||
# define Q_NODISCARD_CTOR [[nodiscard]]
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_cpp_attribute(maybe_unused)
|
||||
# undef Q_DECL_UNUSED
|
||||
# define Q_DECL_UNUSED [[maybe_unused]]
|
||||
@ -1005,6 +1010,9 @@
|
||||
#ifndef Q_REQUIRED_RESULT
|
||||
# define Q_REQUIRED_RESULT
|
||||
#endif
|
||||
#ifndef Q_NODISCARD_CTOR
|
||||
# define Q_NODISCARD_CTOR
|
||||
#endif
|
||||
#ifndef Q_DECL_DEPRECATED
|
||||
# define Q_DECL_DEPRECATED
|
||||
#endif
|
||||
@ -1368,6 +1376,20 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 202002L // P0846 doesn't have a feature macro :/
|
||||
# define QT_COMPILER_HAS_P0846
|
||||
#endif
|
||||
|
||||
#ifdef QT_COMPILER_HAS_P0846
|
||||
# define QT_ENABLE_P0846_SEMANTICS_FOR(func)
|
||||
#else
|
||||
class QT_CLASS_JUST_FOR_P0846_SIMULATION;
|
||||
# define QT_ENABLE_P0846_SEMANTICS_FOR(func) \
|
||||
template <typename T> \
|
||||
void func (QT_CLASS_JUST_FOR_P0846_SIMULATION *); \
|
||||
/* end */
|
||||
#endif // !P0846
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // QCOMPILERDETECTION_H
|
||||
|
@ -175,7 +175,7 @@
|
||||
\since 5.8
|
||||
|
||||
Can be used in switch statements at the end of case block to tell the compiler
|
||||
and other developers that that the lack of a break statement is intentional.
|
||||
and other developers that the lack of a break statement is intentional.
|
||||
|
||||
This is useful since a missing break statement is often a bug, and some
|
||||
compilers can be configured to emit warnings when one is not found.
|
||||
@ -197,7 +197,7 @@
|
||||
|
||||
\snippet code/src_corelib_global_qglobal.cpp qlikely
|
||||
|
||||
\sa Q_UNLIKELY(), Q_ASSUME()
|
||||
\sa Q_UNLIKELY()
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -392,3 +392,21 @@
|
||||
|
||||
If this macro is used outside a function, the behavior is undefined.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_NODISCARD_CTOR
|
||||
\relates <QtCompilerDetection>
|
||||
\since 6.6
|
||||
|
||||
\brief Expands to \c{[[nodiscard]]} on compilers that accept it on constructors.
|
||||
|
||||
Otherwise it expands to nothing.
|
||||
|
||||
Constructors marked as Q_NODISCARD_CTOR cause a compiler warning if a call
|
||||
site doesn't use the resulting object.
|
||||
|
||||
This macro is exists solely to prevent warnings on compilers that don't
|
||||
implement the feature. If your supported platforms all allow \c{[[nodiscard]]}
|
||||
on constructors, we strongly recommend you use the C++ attribute directly instead
|
||||
of this macro.
|
||||
*/
|
||||
|
@ -63,6 +63,7 @@
|
||||
#define QT_FEATURE_jalalicalendar -1
|
||||
#define QT_FEATURE_journald -1
|
||||
#define QT_FEATURE_futimens -1
|
||||
#undef QT_FEATURE_future
|
||||
#define QT_FEATURE_future -1
|
||||
#define QT_FEATURE_itemmodel -1
|
||||
#define QT_FEATURE_library -1
|
||||
@ -81,7 +82,6 @@
|
||||
# define QT_FEATURE_renameat2 -1
|
||||
#endif
|
||||
#define QT_FEATURE_shortcut -1
|
||||
#define QT_FEATURE_signaling_nan -1
|
||||
#define QT_FEATURE_slog2 -1
|
||||
#ifdef __GLIBC_PREREQ
|
||||
# define QT_FEATURE_statx (__GLIBC_PREREQ(2, 28) ? 1 : -1)
|
||||
@ -92,6 +92,7 @@
|
||||
#define QT_NO_SYSTEMLOCALE
|
||||
#define QT_FEATURE_temporaryfile 1
|
||||
#define QT_FEATURE_textdate 1
|
||||
#undef QT_FEATURE_thread
|
||||
#define QT_FEATURE_thread -1
|
||||
#define QT_FEATURE_timezone -1
|
||||
#define QT_FEATURE_topleveldomain -1
|
||||
|
@ -50,6 +50,11 @@ inline constexpr bool has_size_v = false;
|
||||
template<typename C>
|
||||
inline constexpr bool has_size_v<C, std::void_t<decltype(C().size())>> = true;
|
||||
|
||||
template<typename C, typename = void>
|
||||
inline constexpr bool has_reserve_v = false;
|
||||
template<typename C>
|
||||
inline constexpr bool has_reserve_v<C, std::void_t<decltype(C().reserve(0))>> = true;
|
||||
|
||||
template<typename C, typename = void>
|
||||
inline constexpr bool has_clear_v = false;
|
||||
template<typename C>
|
||||
|
@ -105,6 +105,23 @@ inline constexpr T qbswap(T source)
|
||||
return T(qbswap_helper(typename QIntegerForSizeof<T>::Unsigned(source)));
|
||||
}
|
||||
|
||||
#ifdef QT_SUPPORTS_INT128
|
||||
// extra definitions for q(u)int128, in case std::is_integral_v<~~> == false
|
||||
inline constexpr quint128 qbswap(quint128 source)
|
||||
{
|
||||
quint128 result = {};
|
||||
result = qbswap_helper(quint64(source));
|
||||
result <<= 64;
|
||||
result |= qbswap_helper(quint64(source >> 64));
|
||||
return result;
|
||||
}
|
||||
|
||||
inline constexpr quint128 qbswap(qint128 source)
|
||||
{
|
||||
return qint128(qbswap(quint128(source)));
|
||||
}
|
||||
#endif
|
||||
|
||||
// floating specializations
|
||||
template<typename Float>
|
||||
Float qbswapFloatHelper(Float source)
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qcompilerdetection.h>
|
||||
#include <QtCore/qtcoreexports.h>
|
||||
|
||||
#if 0
|
||||
#pragma qt_class(QtExceptionHandling)
|
||||
|
@ -1,12 +1,12 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/qcompare_impl.h>
|
||||
|
||||
#ifndef QFLAGS_H
|
||||
#define QFLAGS_H
|
||||
|
||||
#include <QtCore/qcompare_impl.h>
|
||||
#include <QtCore/qtypeinfo.h>
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
inline operator float() const noexcept;
|
||||
#endif
|
||||
template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T> && !std::is_same_v<T, NearestFloat>>>
|
||||
explicit qfloat16(T value) noexcept : qfloat16(NearestFloat(value)) {}
|
||||
constexpr explicit qfloat16(T value) noexcept : qfloat16(NearestFloat(value)) {}
|
||||
|
||||
// Support for qIs{Inf,NaN,Finite}:
|
||||
bool isInf() const noexcept { return (b16 & 0x7fff) == 0x7c00; }
|
||||
|
@ -27,20 +27,21 @@
|
||||
|
||||
#include <QtCore/qtpreprocessorsupport.h>
|
||||
|
||||
#include <QtCore/qtnoop.h>
|
||||
|
||||
#include <QtCore/qsystemdetection.h>
|
||||
#include <QtCore/qprocessordetection.h>
|
||||
#include <QtCore/qcompilerdetection.h>
|
||||
|
||||
#include <QtCore/qassert.h>
|
||||
#include <QtCore/qtypes.h>
|
||||
#include <QtCore/qtclasshelpermacros.h>
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
# include <QtCore/qassert.h>
|
||||
# include <QtCore/qtnoop.h>
|
||||
# include <QtCore/qtypes.h>
|
||||
#endif /* !__ASSEMBLER__ */
|
||||
#include <QtCore/qtversion.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
#include <QtCore/qtclasshelpermacros.h>
|
||||
|
||||
// We need to keep QTypeInfo, QSysInfo, QFlags, qDebug & family in qglobal.h for compatibility with Qt 4.
|
||||
// Be careful when changing the order of these files.
|
||||
#include <QtCore/qtypeinfo.h>
|
||||
|
@ -52,21 +52,9 @@
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#ifdef Q_CC_MINGW
|
||||
# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r()
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
// These behave as if they consult the environment, so need to share its locking:
|
||||
Q_CORE_EXPORT void qTzSet();
|
||||
Q_CORE_EXPORT time_t qMkTime(struct tm *when);
|
||||
|
||||
#if !defined(Q_CC_MSVC)
|
||||
Q_NORETURN
|
||||
#endif
|
||||
Q_CORE_EXPORT void qAbort();
|
||||
Q_NORETURN Q_CORE_EXPORT void qAbort();
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@ -142,4 +130,3 @@ QT_END_NAMESPACE
|
||||
#endif // defined(__cplusplus)
|
||||
|
||||
#endif // QGLOBAL_P_H
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
// Copyright (C) 2021 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef QGLOBALSTATIC_H
|
||||
#define QGLOBALSTATIC_H
|
||||
|
||||
#include <QtCore/qassert.h>
|
||||
#include <QtCore/qatomic.h>
|
||||
#include <QtCore/qtclasshelpermacros.h>
|
||||
|
||||
#include <atomic> // for bootstrapped (no thread) builds
|
||||
#include <type_traits>
|
||||
@ -75,13 +74,13 @@ template <typename Holder> struct QGlobalStatic
|
||||
}
|
||||
Type *operator->()
|
||||
{
|
||||
Q_ASSERT_X(!isDestroyed(), "Q_GLOBAL_STATIC",
|
||||
Q_ASSERT_X(!isDestroyed(), Q_FUNC_INFO,
|
||||
"The global static was used after being destroyed");
|
||||
return instance();
|
||||
}
|
||||
Type &operator*()
|
||||
{
|
||||
Q_ASSERT_X(!isDestroyed(), "Q_GLOBAL_STATIC",
|
||||
Q_ASSERT_X(!isDestroyed(), Q_FUNC_INFO,
|
||||
"The global static was used after being destroyed");
|
||||
return *instance();
|
||||
}
|
||||
|
@ -540,8 +540,8 @@ QString QLibraryInfoPrivate::path(QLibraryInfo::LibraryPath p, UsageMode usageMo
|
||||
ret = v.toString();
|
||||
}
|
||||
|
||||
int startIndex = 0;
|
||||
forever {
|
||||
qsizetype startIndex = 0;
|
||||
while (true) {
|
||||
startIndex = ret.indexOf(u'$', startIndex);
|
||||
if (startIndex < 0)
|
||||
break;
|
||||
@ -551,7 +551,7 @@ QString QLibraryInfoPrivate::path(QLibraryInfo::LibraryPath p, UsageMode usageMo
|
||||
startIndex++;
|
||||
continue;
|
||||
}
|
||||
int endIndex = ret.indexOf(u')', startIndex + 2);
|
||||
qsizetype endIndex = ret.indexOf(u')', startIndex + 2);
|
||||
if (endIndex < 0)
|
||||
break;
|
||||
auto envVarName = QStringView{ret}.mid(startIndex + 2, endIndex - startIndex - 2);
|
||||
|
@ -163,10 +163,11 @@ Q_TRACE_POINT(qtcore, qt_message_print, int type, const char *category, const ch
|
||||
\snippet code/src_corelib_global_qglobal.cpp 4
|
||||
*/
|
||||
|
||||
#if !defined(Q_CC_MSVC)
|
||||
template <typename String>
|
||||
#if !defined(Q_CC_MSVC_ONLY)
|
||||
Q_NORETURN
|
||||
#endif
|
||||
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message);
|
||||
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, String &&message);
|
||||
static void qt_message_print(QtMsgType, const QMessageLogContext &context, const QString &message);
|
||||
static void qt_message_print(const QString &message);
|
||||
|
||||
@ -347,7 +348,7 @@ using namespace QtPrivate;
|
||||
\sa QMessageLogContext, qDebug(), qInfo(), qWarning(), qCritical(), qFatal()
|
||||
*/
|
||||
|
||||
#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
|
||||
#if defined(Q_CC_MSVC_ONLY) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
|
||||
static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const char *s) noexcept
|
||||
{
|
||||
size_t len = qstrlen(s);
|
||||
@ -368,11 +369,13 @@ static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const cha
|
||||
\internal
|
||||
*/
|
||||
Q_NEVER_INLINE
|
||||
static QString qt_message(QtMsgType msgType, const QMessageLogContext &context, const char *msg, va_list ap)
|
||||
static void qt_message(QtMsgType msgType, const QMessageLogContext &context, const char *msg, va_list ap)
|
||||
{
|
||||
QString buf = QString::vasprintf(msg, ap);
|
||||
qt_message_print(msgType, context, buf);
|
||||
return buf;
|
||||
|
||||
if (isFatal(msgType))
|
||||
qt_message_fatal(msgType, context, buf);
|
||||
}
|
||||
|
||||
#undef qDebug
|
||||
@ -386,11 +389,8 @@ void QMessageLogger::debug(const char *msg, ...) const
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtDebugMsg, context, msg, ap);
|
||||
qt_message(QtDebugMsg, context, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtDebugMsg))
|
||||
qt_message_fatal(QtDebugMsg, context, message);
|
||||
}
|
||||
|
||||
|
||||
@ -406,11 +406,8 @@ void QMessageLogger::info(const char *msg, ...) const
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtInfoMsg, context, msg, ap);
|
||||
qt_message(QtInfoMsg, context, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtInfoMsg))
|
||||
qt_message_fatal(QtInfoMsg, context, message);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -445,11 +442,8 @@ void QMessageLogger::debug(const QLoggingCategory &cat, const char *msg, ...) co
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtDebugMsg, ctxt, msg, ap);
|
||||
qt_message(QtDebugMsg, ctxt, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtDebugMsg))
|
||||
qt_message_fatal(QtDebugMsg, ctxt, message);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -472,11 +466,8 @@ void QMessageLogger::debug(QMessageLogger::CategoryFunction catFunc,
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtDebugMsg, ctxt, msg, ap);
|
||||
qt_message(QtDebugMsg, ctxt, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtDebugMsg))
|
||||
qt_message_fatal(QtDebugMsg, ctxt, message);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
@ -556,11 +547,8 @@ void QMessageLogger::info(const QLoggingCategory &cat, const char *msg, ...) con
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtInfoMsg, ctxt, msg, ap);
|
||||
qt_message(QtInfoMsg, ctxt, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtInfoMsg))
|
||||
qt_message_fatal(QtInfoMsg, ctxt, message);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -583,11 +571,8 @@ void QMessageLogger::info(QMessageLogger::CategoryFunction catFunc,
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtInfoMsg, ctxt, msg, ap);
|
||||
qt_message(QtInfoMsg, ctxt, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtInfoMsg))
|
||||
qt_message_fatal(QtInfoMsg, ctxt, message);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
@ -649,11 +634,8 @@ void QMessageLogger::warning(const char *msg, ...) const
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtWarningMsg, context, msg, ap);
|
||||
qt_message(QtWarningMsg, context, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtWarningMsg))
|
||||
qt_message_fatal(QtWarningMsg, context, message);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -674,11 +656,8 @@ void QMessageLogger::warning(const QLoggingCategory &cat, const char *msg, ...)
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtWarningMsg, ctxt, msg, ap);
|
||||
qt_message(QtWarningMsg, ctxt, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtWarningMsg))
|
||||
qt_message_fatal(QtWarningMsg, ctxt, message);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -701,11 +680,8 @@ void QMessageLogger::warning(QMessageLogger::CategoryFunction catFunc,
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtWarningMsg, ctxt, msg, ap);
|
||||
qt_message(QtWarningMsg, ctxt, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtWarningMsg))
|
||||
qt_message_fatal(QtWarningMsg, ctxt, message);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
@ -765,11 +741,8 @@ void QMessageLogger::critical(const char *msg, ...) const
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtCriticalMsg, context, msg, ap);
|
||||
qt_message(QtCriticalMsg, context, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtCriticalMsg))
|
||||
qt_message_fatal(QtCriticalMsg, context, message);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -790,11 +763,8 @@ void QMessageLogger::critical(const QLoggingCategory &cat, const char *msg, ...)
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtCriticalMsg, ctxt, msg, ap);
|
||||
qt_message(QtCriticalMsg, ctxt, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtCriticalMsg))
|
||||
qt_message_fatal(QtCriticalMsg, ctxt, message);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -817,11 +787,8 @@ void QMessageLogger::critical(QMessageLogger::CategoryFunction catFunc,
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
const QString message = qt_message(QtCriticalMsg, ctxt, msg, ap);
|
||||
qt_message(QtCriticalMsg, ctxt, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (isFatal(QtCriticalMsg))
|
||||
qt_message_fatal(QtCriticalMsg, ctxt, message);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
@ -885,14 +852,14 @@ void QMessageLogger::fatal(const QLoggingCategory &cat, const char *msg, ...) co
|
||||
ctxt.copyContextFrom(context);
|
||||
ctxt.category = cat.categoryName();
|
||||
|
||||
QString message;
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
QT_TERMINATE_ON_EXCEPTION(message = qt_message(QtFatalMsg, ctxt, msg, ap));
|
||||
QT_TERMINATE_ON_EXCEPTION(qt_message(QtFatalMsg, ctxt, msg, ap));
|
||||
va_end(ap);
|
||||
|
||||
qt_message_fatal(QtCriticalMsg, ctxt, message);
|
||||
#ifndef Q_CC_MSVC_ONLY
|
||||
Q_UNREACHABLE();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -911,14 +878,14 @@ void QMessageLogger::fatal(QMessageLogger::CategoryFunction catFunc,
|
||||
ctxt.copyContextFrom(context);
|
||||
ctxt.category = cat.categoryName();
|
||||
|
||||
QString message;
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
QT_TERMINATE_ON_EXCEPTION(message = qt_message(QtFatalMsg, ctxt, msg, ap));
|
||||
QT_TERMINATE_ON_EXCEPTION(qt_message(QtFatalMsg, ctxt, msg, ap));
|
||||
va_end(ap);
|
||||
|
||||
qt_message_fatal(QtFatalMsg, ctxt, message);
|
||||
#ifndef Q_CC_MSVC_ONLY
|
||||
Q_UNREACHABLE();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -929,14 +896,14 @@ void QMessageLogger::fatal(QMessageLogger::CategoryFunction catFunc,
|
||||
*/
|
||||
void QMessageLogger::fatal(const char *msg, ...) const noexcept
|
||||
{
|
||||
QString message;
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
QT_TERMINATE_ON_EXCEPTION(message = qt_message(QtFatalMsg, context, msg, ap));
|
||||
QT_TERMINATE_ON_EXCEPTION(qt_message(QtFatalMsg, context, msg, ap));
|
||||
va_end(ap);
|
||||
|
||||
qt_message_fatal(QtFatalMsg, context, message);
|
||||
#ifndef Q_CC_MSVC_ONLY
|
||||
Q_UNREACHABLE();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
@ -1638,12 +1605,12 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
|
||||
QString timeFormat = pattern->timeArgs.at(timeArgsIdx);
|
||||
timeArgsIdx++;
|
||||
if (timeFormat == "process"_L1) {
|
||||
quint64 ms = pattern->timer.elapsed();
|
||||
message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));
|
||||
quint64 ms = pattern->timer.elapsed();
|
||||
message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));
|
||||
} else if (timeFormat == "boot"_L1) {
|
||||
// just print the milliseconds since the elapsed timer reference
|
||||
// like the Linux kernel does
|
||||
uint ms = QDeadlineTimer::current().deadline();
|
||||
qint64 ms = QDeadlineTimer::current().deadline();
|
||||
message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));
|
||||
#if QT_CONFIG(datestring)
|
||||
} else if (timeFormat.isEmpty()) {
|
||||
@ -2032,9 +1999,10 @@ static void qt_message_print(const QString &message)
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message)
|
||||
template <typename String>
|
||||
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, String &&message)
|
||||
{
|
||||
#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
|
||||
#if defined(Q_CC_MSVC_ONLY) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
|
||||
wchar_t contextFileL[256];
|
||||
// we probably should let the compiler do this for us, by declaring QMessageLogContext::file to
|
||||
// be const wchar_t * in the first place, but the #ifdefery above is very complex and we
|
||||
@ -2053,13 +2021,15 @@ static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const
|
||||
_CrtDbgBreak();
|
||||
#else
|
||||
Q_UNUSED(context);
|
||||
Q_UNUSED(message);
|
||||
#endif
|
||||
|
||||
if constexpr (std::is_class_v<String> && !std::is_const_v<String>)
|
||||
message.clear();
|
||||
else
|
||||
Q_UNUSED(message);
|
||||
qAbort();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
|
@ -1,11 +1,14 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef QLOGGING_H
|
||||
#define QLOGGING_H
|
||||
|
||||
#include <QtCore/qtclasshelpermacros.h>
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qtcoreexports.h>
|
||||
#include <QtCore/qcontainerfwd.h>
|
||||
|
||||
#if 0
|
||||
// header is automatically included in qglobal.h
|
||||
#pragma qt_no_master_include
|
||||
@ -22,6 +25,7 @@ QT_BEGIN_NAMESPACE
|
||||
class QDebug;
|
||||
class QNoDebug;
|
||||
|
||||
|
||||
enum QtMsgType {
|
||||
QtDebugMsg,
|
||||
QtWarningMsg,
|
||||
@ -54,7 +58,7 @@ private:
|
||||
|
||||
class QLoggingCategory;
|
||||
|
||||
#ifdef Q_CC_MSVC
|
||||
#if defined(Q_CC_MSVC_ONLY)
|
||||
# define QT_MESSAGE_LOGGER_NORETURN
|
||||
#else
|
||||
# define QT_MESSAGE_LOGGER_NORETURN Q_NORETURN
|
||||
|
@ -94,9 +94,11 @@
|
||||
\value AA_DontShowShortcutsInContextMenus Actions with the Shortcut property
|
||||
won't be shown in any shortcut menus unless specifically set by the
|
||||
QAction::shortcutVisibleInContextMenu property. This value was added
|
||||
in Qt 5.10, and defaults to the preference reported by the implementation
|
||||
of QPlatformIntegration::styleHint. To override the platform integration,
|
||||
set this attribute after QCoreApplication has been instantiated.
|
||||
in Qt 5.10, and is by default based on the value reported by
|
||||
QStyleHints::showShortcutsInContextMenus(). To override the default
|
||||
behavior, set the style hint before QCoreApplication has been
|
||||
instantiated, or set this attribute after QCoreApplication has
|
||||
been instantiated.
|
||||
|
||||
\value AA_NativeWindows Ensures that widgets have native windows.
|
||||
|
||||
|
@ -8,7 +8,9 @@
|
||||
#pragma qt_class(QtNumeric)
|
||||
#endif
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qtcoreexports.h>
|
||||
#include <QtCore/qtypes.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
@ -180,7 +180,7 @@ static inline bool convertDoubleTo(double v, T *value, bool allow_precision_upgr
|
||||
// correct, but Clang, ICC and MSVC don't realize that it's a constant and
|
||||
// the math call stays in the compiled code.
|
||||
|
||||
#ifdef Q_PROCESSOR_X86_64
|
||||
#if defined(Q_PROCESSOR_X86_64) && defined(__SSE2__)
|
||||
// Of course, UB doesn't apply if we use intrinsics, in which case we are
|
||||
// allowed to dpeend on exactly the processor's behavior. This
|
||||
// implementation uses the truncating conversions from Scalar Double to
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
#if defined(Q_PROCESSOR_X86) && defined(Q_CC_MSVC)
|
||||
// MSVC doesn't define __SSE2__, so do it ourselves
|
||||
# if (defined(_M_X64) || _M_IX86_FP >= 2)
|
||||
# if (defined(_M_X64) || _M_IX86_FP >= 2) && defined(QT_COMPILER_SUPPORTS_SSE2)
|
||||
# define __SSE__ 1
|
||||
# define __SSE2__ 1
|
||||
# endif
|
||||
|
@ -218,31 +218,29 @@ asm(
|
||||
// x86-64 sub-architecture version 3
|
||||
//
|
||||
// The Intel Core 4th generation was codenamed "Haswell" and introduced AVX2,
|
||||
// BMI1, BMI2, FMA, LZCNT, MOVBE. This feature set was chosen as the version 3
|
||||
// of the x86-64 ISA (x86-64-v3) and is supported by GCC and Clang. On systems
|
||||
// with the GNU libc, libraries with this feature can be installed on a
|
||||
// "glibc-hwcaps/x86-64-v3" subdir. macOS's fat binaries support the "x86_64h"
|
||||
// sub-architecture too.
|
||||
|
||||
# if defined(__AVX2__)
|
||||
// List of features present with -march=x86-64-v3 and not architecturally
|
||||
// implied by __AVX2__
|
||||
# define ARCH_HASWELL_MACROS \
|
||||
(__AVX2__ && __BMI__ && __BMI2__ && __F16C__ && __FMA__ && __LZCNT__ && __POPCNT__)
|
||||
# if ARCH_HASWELL_MACROS == 0
|
||||
// BMI1, BMI2, FMA, LZCNT, MOVBE, which makes it a good divider for a
|
||||
// sub-target for us. The first AMD processor with AVX2 support (Zen) has the
|
||||
// same features, but had already introduced BMI1 in the previous generation.
|
||||
// This feature set was chosen as the version 3 of the x86-64 ISA (x86-64-v3)
|
||||
// and is supported by GCC and Clang.
|
||||
//
|
||||
// macOS's fat binaries support the "x86_64h" sub-architecture and the GNU libc
|
||||
// ELF loader also supports a "haswell/" subdir (e.g., /usr/lib/haswell).
|
||||
# define ARCH_HASWELL_MACROS (__AVX2__ + __FMA__)
|
||||
# if ARCH_HASWELL_MACROS != 0
|
||||
# if ARCH_HASWELL_MACROS != 2
|
||||
# error "Please enable all x86-64-v3 extensions; you probably want to use -march=haswell or -march=x86-64-v3 instead of -mavx2"
|
||||
# endif
|
||||
static_assert(ARCH_HASWELL_MACROS, "Undeclared identifiers indicate which features are missing.");
|
||||
# define __haswell__ 1
|
||||
# undef ARCH_HASWELL_MACROS
|
||||
# endif
|
||||
# undef ARCH_HASWELL_MACROS
|
||||
|
||||
// x86-64 sub-architecture version 4
|
||||
//
|
||||
// Similar to the above, x86-64-v4 matches the AVX512 variant of the Intel Core
|
||||
// 6th generation (codename "Skylake"). AMD Zen4 is the their first processor
|
||||
// with AVX512 support and it includes all of these too. The GNU libc subdir for
|
||||
// this is "glibc-hwcaps/x86-64-v4".
|
||||
// with AVX512 support and it includes all of these too.
|
||||
//
|
||||
# define ARCH_SKX_MACROS (__AVX512F__ + __AVX512BW__ + __AVX512CD__ + __AVX512DQ__ + __AVX512VL__)
|
||||
# if ARCH_SKX_MACROS != 0
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Copyright (C) 2022 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
// This is a generated file. DO NOT EDIT.
|
||||
// Please see util/x86simdgen/README.md
|
||||
|
||||
#include "qsimd_x86_p.h"
|
||||
|
||||
static const char features_string[] =
|
||||
@ -30,24 +30,28 @@ static const char features_string[] =
|
||||
" avx512bw\0"
|
||||
" avx512vl\0"
|
||||
" avx512vbmi\0"
|
||||
" waitpkg\0"
|
||||
" avx512vbmi2\0"
|
||||
" shstk\0"
|
||||
" gfni\0"
|
||||
" vaes\0"
|
||||
" avx512vnni\0"
|
||||
" avx512bitalg\0"
|
||||
" avx512vpopcntdq\0"
|
||||
" hybrid\0"
|
||||
" ibt\0"
|
||||
" avx512fp16\0"
|
||||
" raoint\0"
|
||||
" cmpccxadd\0"
|
||||
" avxifma\0"
|
||||
" lam\0"
|
||||
"\0";
|
||||
|
||||
static const uint16_t features_indices[] = {
|
||||
0, 6, 12, 19, 24, 32, 40, 47,
|
||||
55, 60, 65, 71, 78, 83, 89, 95,
|
||||
104, 114, 122, 134, 144, 149, 159, 169,
|
||||
181, 194, 201, 207, 213, 225, 239, 256,
|
||||
264, 269,
|
||||
181, 190, 203, 210, 216, 222, 236, 253,
|
||||
261, 266, 278, 286, 297, 306,
|
||||
};
|
||||
|
||||
enum X86CpuidLeaves {
|
||||
@ -57,6 +61,7 @@ enum X86CpuidLeaves {
|
||||
Leaf07_00ECX,
|
||||
Leaf07_00EDX,
|
||||
Leaf07_01EAX,
|
||||
Leaf07_01EDX,
|
||||
Leaf13_01EAX,
|
||||
Leaf80000001hECX,
|
||||
Leaf80000008hEBX,
|
||||
@ -88,16 +93,20 @@ static const uint16_t x86_locators[] = {
|
||||
Leaf07_00EBX*32 + 30, // avx512bw
|
||||
Leaf07_00EBX*32 + 31, // avx512vl
|
||||
Leaf07_00ECX*32 + 1, // avx512vbmi
|
||||
Leaf07_00ECX*32 + 5, // waitpkg
|
||||
Leaf07_00ECX*32 + 6, // avx512vbmi2
|
||||
Leaf07_00ECX*32 + 7, // shstk
|
||||
Leaf07_00ECX*32 + 8, // gfni
|
||||
Leaf07_00ECX*32 + 9, // vaes
|
||||
Leaf07_00ECX*32 + 11, // avx512vnni
|
||||
Leaf07_00ECX*32 + 12, // avx512bitalg
|
||||
Leaf07_00ECX*32 + 14, // avx512vpopcntdq
|
||||
Leaf07_00EDX*32 + 15, // hybrid
|
||||
Leaf07_00EDX*32 + 20, // ibt
|
||||
Leaf07_00EDX*32 + 23, // avx512fp16
|
||||
Leaf07_01EAX*32 + 3, // raoint
|
||||
Leaf07_01EAX*32 + 6, // cmpccxadd
|
||||
Leaf07_01EAX*32 + 23, // avxifma
|
||||
Leaf07_01EAX*32 + 26, // lam
|
||||
};
|
||||
|
||||
struct X86Architecture
|
||||
@ -107,25 +116,31 @@ struct X86Architecture
|
||||
};
|
||||
|
||||
static const struct X86Architecture x86_architectures[] = {
|
||||
{ cpu_sapphirerapids, "Sapphire Rapids" },
|
||||
{ cpu_tigerlake, "Tiger Lake" },
|
||||
{ cpu_icelake_server, "Ice Lake (Server)" },
|
||||
{ cpu_icelake_client, "Ice Lake (Client)" },
|
||||
{ cpu_alderlake, "Alder Lake" },
|
||||
{ cpu_cannonlake, "Cannon Lake" },
|
||||
{ cpu_cooperlake, "Cooper Lake" },
|
||||
{ cpu_cascadelake, "Cascade Lake" },
|
||||
{ cpu_skylake_avx512, "Skylake (Avx512)" },
|
||||
{ cpu_skylake, "Skylake" },
|
||||
{ cpu_tremont, "Tremont" },
|
||||
{ cpu_broadwell, "Broadwell" },
|
||||
{ cpu_haswell, "Haswell" },
|
||||
{ cpu_goldmont, "Goldmont" },
|
||||
{ cpu_ivybridge, "Ivy Bridge" },
|
||||
{ cpu_silvermont, "Silvermont" },
|
||||
{ cpu_sandybridge, "Sandy Bridge" },
|
||||
{ cpu_westmere, "Westmere" },
|
||||
{ cpu_core2, "Core2" },
|
||||
{ cpu_westmere, "Westmere" },
|
||||
{ cpu_sandybridge, "Sandy Bridge" },
|
||||
{ cpu_silvermont, "Silvermont" },
|
||||
{ cpu_ivybridge, "Ivy Bridge" },
|
||||
{ cpu_goldmont, "Goldmont" },
|
||||
{ cpu_haswell, "Haswell" },
|
||||
{ cpu_broadwell, "Broadwell" },
|
||||
{ cpu_tremont, "Tremont" },
|
||||
{ cpu_skylake, "Skylake" },
|
||||
{ cpu_skylake_avx512, "Skylake (Avx512)" },
|
||||
{ cpu_cascadelake, "Cascade Lake" },
|
||||
{ cpu_cooperlake, "Cooper Lake" },
|
||||
{ cpu_cannonlake, "Cannon Lake" },
|
||||
{ cpu_gracemont, "Gracemont" },
|
||||
{ cpu_icelake_client, "Ice Lake (Client)" },
|
||||
{ cpu_icelake_server, "Ice Lake (Server)" },
|
||||
{ cpu_crestmont, "Crestmont" },
|
||||
{ cpu_tigerlake, "Tiger Lake" },
|
||||
{ cpu_clearwaterforest, "Clearwater Forest" },
|
||||
{ cpu_grandridge, "Grand Ridge" },
|
||||
{ cpu_raptorcove, "Raptor Cove" },
|
||||
{ cpu_redwoodcove, "Redwood Cove" },
|
||||
{ cpu_emeraldrapids, "Emerald Rapids" },
|
||||
{ cpu_graniterapids, "Granite Rapids" },
|
||||
};
|
||||
|
||||
enum XSaveBits {
|
||||
@ -168,10 +183,10 @@ static const uint64_t XSaveReq_AvxState = 0
|
||||
| cpu_feature_avx512vbmi
|
||||
| cpu_feature_avx512vbmi2
|
||||
| cpu_feature_vaes
|
||||
| cpu_feature_avx512vnni
|
||||
| cpu_feature_avx512bitalg
|
||||
| cpu_feature_avx512vpopcntdq
|
||||
| cpu_feature_avx512fp16;
|
||||
| cpu_feature_avx512fp16
|
||||
| cpu_feature_avxifma;
|
||||
|
||||
// List of features requiring XSave_Avx512State
|
||||
static const uint64_t XSaveReq_Avx512State = 0
|
||||
@ -183,7 +198,6 @@ static const uint64_t XSaveReq_Avx512State = 0
|
||||
| cpu_feature_avx512vl
|
||||
| cpu_feature_avx512vbmi
|
||||
| cpu_feature_avx512vbmi2
|
||||
| cpu_feature_avx512vnni
|
||||
| cpu_feature_avx512bitalg
|
||||
| cpu_feature_avx512vpopcntdq
|
||||
| cpu_feature_avx512fp16;
|
||||
|
@ -1,5 +1,7 @@
|
||||
// Copyright (C) 2022 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
// This is a generated file. DO NOT EDIT.
|
||||
// Please see util/x86simdgen/README.md
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
@ -50,11 +52,11 @@
|
||||
|
||||
// in CPUID Leaf 7, Sub-leaf 0, ECX:
|
||||
#define cpu_feature_avx512vbmi (UINT64_C(1) << 23)
|
||||
#define cpu_feature_avx512vbmi2 (UINT64_C(1) << 24)
|
||||
#define cpu_feature_shstk (UINT64_C(1) << 25)
|
||||
#define cpu_feature_gfni (UINT64_C(1) << 26)
|
||||
#define cpu_feature_vaes (UINT64_C(1) << 27)
|
||||
#define cpu_feature_avx512vnni (UINT64_C(1) << 28)
|
||||
#define cpu_feature_waitpkg (UINT64_C(1) << 24)
|
||||
#define cpu_feature_avx512vbmi2 (UINT64_C(1) << 25)
|
||||
#define cpu_feature_shstk (UINT64_C(1) << 26)
|
||||
#define cpu_feature_gfni (UINT64_C(1) << 27)
|
||||
#define cpu_feature_vaes (UINT64_C(1) << 28)
|
||||
#define cpu_feature_avx512bitalg (UINT64_C(1) << 29)
|
||||
#define cpu_feature_avx512vpopcntdq (UINT64_C(1) << 30)
|
||||
|
||||
@ -63,6 +65,12 @@
|
||||
#define cpu_feature_ibt (UINT64_C(1) << 32)
|
||||
#define cpu_feature_avx512fp16 (UINT64_C(1) << 33)
|
||||
|
||||
// in CPUID Leaf 7, Sub-leaf 1, EAX:
|
||||
#define cpu_feature_raoint (UINT64_C(1) << 34)
|
||||
#define cpu_feature_cmpccxadd (UINT64_C(1) << 35)
|
||||
#define cpu_feature_avxifma (UINT64_C(1) << 36)
|
||||
#define cpu_feature_lam (UINT64_C(1) << 37)
|
||||
|
||||
// CPU architectures
|
||||
#define cpu_x86_64 (0 \
|
||||
| cpu_feature_sse2)
|
||||
@ -89,42 +97,65 @@
|
||||
| cpu_feature_rdseed)
|
||||
#define cpu_bdx (cpu_bdw)
|
||||
#define cpu_skl (cpu_bdw)
|
||||
#define cpu_adl (cpu_skl \
|
||||
| cpu_feature_gfni \
|
||||
| cpu_feature_vaes \
|
||||
| cpu_feature_shstk \
|
||||
| cpu_feature_ibt)
|
||||
#define cpu_skx (cpu_skl \
|
||||
| cpu_feature_avx512f \
|
||||
| cpu_feature_avx512dq \
|
||||
| cpu_feature_avx512cd \
|
||||
| cpu_feature_avx512bw \
|
||||
| cpu_feature_avx512vl)
|
||||
#define cpu_clx (cpu_skx \
|
||||
| cpu_feature_avx512vnni)
|
||||
#define cpu_clx (cpu_skx)
|
||||
#define cpu_cpx (cpu_clx)
|
||||
#define cpu_cnl (cpu_skx \
|
||||
#define cpu_plc (cpu_skx \
|
||||
| cpu_feature_avx512ifma \
|
||||
| cpu_feature_avx512vbmi)
|
||||
#define cpu_icl (cpu_cnl \
|
||||
#define cpu_snc (cpu_plc \
|
||||
| cpu_feature_avx512vbmi2 \
|
||||
| cpu_feature_gfni \
|
||||
| cpu_feature_vaes \
|
||||
| cpu_feature_avx512vnni \
|
||||
| cpu_feature_avx512bitalg \
|
||||
| cpu_feature_avx512vpopcntdq)
|
||||
#define cpu_icx (cpu_icl)
|
||||
#define cpu_tgl (cpu_icl \
|
||||
#define cpu_wlc (cpu_snc \
|
||||
| cpu_feature_shstk \
|
||||
| cpu_feature_ibt)
|
||||
#define cpu_spr (cpu_tgl)
|
||||
#define cpu_glc (cpu_wlc \
|
||||
| cpu_feature_waitpkg)
|
||||
#define cpu_rpc (cpu_glc)
|
||||
#define cpu_rwc (cpu_rpc)
|
||||
#define cpu_slm (cpu_wsm \
|
||||
| cpu_feature_rdrnd \
|
||||
| cpu_feature_movbe)
|
||||
#define cpu_glm (cpu_slm \
|
||||
| cpu_feature_rdseed)
|
||||
#define cpu_tnt (cpu_glm \
|
||||
| cpu_feature_gfni)
|
||||
| cpu_feature_gfni \
|
||||
| cpu_feature_waitpkg)
|
||||
#define cpu_grt (cpu_skl \
|
||||
| cpu_feature_gfni \
|
||||
| cpu_feature_vaes \
|
||||
| cpu_feature_shstk \
|
||||
| cpu_feature_ibt \
|
||||
| cpu_feature_waitpkg)
|
||||
#define cpu_cmt (cpu_grt \
|
||||
| cpu_feature_cmpccxadd \
|
||||
| cpu_feature_avxifma)
|
||||
#define cpu_cnl (cpu_plc)
|
||||
#define cpu_icl (cpu_snc)
|
||||
#define cpu_tgl (cpu_wlc)
|
||||
#define cpu_adl (cpu_grt)
|
||||
#define cpu_rpl (cpu_grt)
|
||||
#define cpu_mtl (cpu_cmt)
|
||||
#define cpu_arl (cpu_cmt)
|
||||
#define cpu_lnl (cpu_cmt)
|
||||
#define cpu_icx (cpu_snc)
|
||||
#define cpu_spr (cpu_glc)
|
||||
#define cpu_emr (cpu_spr)
|
||||
#define cpu_gnr (cpu_glc)
|
||||
#define cpu_srf (cpu_cmt \
|
||||
| cpu_feature_cmpccxadd \
|
||||
| cpu_feature_avxifma)
|
||||
#define cpu_grr (cpu_srf \
|
||||
| cpu_feature_raoint)
|
||||
#define cpu_cwf (cpu_srf)
|
||||
#define cpu_nehalem (cpu_nhm)
|
||||
#define cpu_westmere (cpu_wsm)
|
||||
#define cpu_sandybridge (cpu_snb)
|
||||
@ -135,15 +166,32 @@
|
||||
#define cpu_skylake_avx512 (cpu_skx)
|
||||
#define cpu_cascadelake (cpu_clx)
|
||||
#define cpu_cooperlake (cpu_cpx)
|
||||
#define cpu_palmcove (cpu_plc)
|
||||
#define cpu_cannonlake (cpu_cnl)
|
||||
#define cpu_sunnycove (cpu_snc)
|
||||
#define cpu_icelake_client (cpu_icl)
|
||||
#define cpu_icelake_server (cpu_icx)
|
||||
#define cpu_alderlake (cpu_adl)
|
||||
#define cpu_sapphirerapids (cpu_spr)
|
||||
#define cpu_willowcove (cpu_wlc)
|
||||
#define cpu_tigerlake (cpu_tgl)
|
||||
#define cpu_goldencove (cpu_glc)
|
||||
#define cpu_alderlake (cpu_adl)
|
||||
#define cpu_raptorcove (cpu_rpc)
|
||||
#define cpu_raptorlake (cpu_rpl)
|
||||
#define cpu_redwoodcove (cpu_rwc)
|
||||
#define cpu_meteorlake (cpu_mtl)
|
||||
#define cpu_arrowlake (cpu_arl)
|
||||
#define cpu_lunarlake (cpu_lnl)
|
||||
#define cpu_sapphirerapids (cpu_spr)
|
||||
#define cpu_emeraldrapids (cpu_emr)
|
||||
#define cpu_graniterapids (cpu_gnr)
|
||||
#define cpu_silvermont (cpu_slm)
|
||||
#define cpu_goldmont (cpu_glm)
|
||||
#define cpu_tremont (cpu_tnt)
|
||||
#define cpu_gracemont (cpu_grt)
|
||||
#define cpu_crestmont (cpu_cmt)
|
||||
#define cpu_grandridge (cpu_grr)
|
||||
#define cpu_sierraforest (cpu_srf)
|
||||
#define cpu_clearwaterforest (cpu_cwf)
|
||||
|
||||
// __attribute__ target strings for GCC and Clang
|
||||
#define QT_FUNCTION_TARGET_STRING_SSE2 "sse2"
|
||||
@ -170,16 +218,20 @@
|
||||
#define QT_FUNCTION_TARGET_STRING_AVX512BW "avx512bw,avx512f"
|
||||
#define QT_FUNCTION_TARGET_STRING_AVX512VL "avx512vl,avx512f"
|
||||
#define QT_FUNCTION_TARGET_STRING_AVX512VBMI "avx512vbmi,avx512f"
|
||||
#define QT_FUNCTION_TARGET_STRING_WAITPKG "waitpkg"
|
||||
#define QT_FUNCTION_TARGET_STRING_AVX512VBMI2 "avx512vbmi2,avx512f"
|
||||
#define QT_FUNCTION_TARGET_STRING_SHSTK "shstk"
|
||||
#define QT_FUNCTION_TARGET_STRING_GFNI "gfni"
|
||||
#define QT_FUNCTION_TARGET_STRING_VAES "vaes,avx2,avx,aes"
|
||||
#define QT_FUNCTION_TARGET_STRING_AVX512VNNI "avx512vnni,avx512f"
|
||||
#define QT_FUNCTION_TARGET_STRING_AVX512BITALG "avx512bitalg,avx512f"
|
||||
#define QT_FUNCTION_TARGET_STRING_AVX512VPOPCNTDQ "avx512vpopcntdq,avx512f"
|
||||
#define QT_FUNCTION_TARGET_STRING_HYBRID "hybrid"
|
||||
#define QT_FUNCTION_TARGET_STRING_IBT "ibt"
|
||||
#define QT_FUNCTION_TARGET_STRING_AVX512FP16 "avx512fp16,avx512f,f16c"
|
||||
#define QT_FUNCTION_TARGET_STRING_RAOINT "raoint"
|
||||
#define QT_FUNCTION_TARGET_STRING_CMPCCXADD "cmpccxadd"
|
||||
#define QT_FUNCTION_TARGET_STRING_AVXIFMA "avxifma,avx"
|
||||
#define QT_FUNCTION_TARGET_STRING_LAM "lam"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_X86_64 "sse2"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CORE2 QT_FUNCTION_TARGET_STRING_ARCH_X86_64 ",sse3,ssse3,cx16"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_NHM QT_FUNCTION_TARGET_STRING_ARCH_CORE2 ",sse4.1,sse4.2,popcnt"
|
||||
@ -190,18 +242,35 @@
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_BDW QT_FUNCTION_TARGET_STRING_ARCH_HSW ",adx,rdseed"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_BDX QT_FUNCTION_TARGET_STRING_ARCH_BDW
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SKL QT_FUNCTION_TARGET_STRING_ARCH_BDW ",xsavec,xsaves"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ADL QT_FUNCTION_TARGET_STRING_ARCH_SKL ",avxvnni,gfni,vaes,vpclmulqdq,serialize,shstk,cldemote,movdiri,movdir64b,ibt,waitpkg,keylocker"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SKX QT_FUNCTION_TARGET_STRING_ARCH_SKL ",avx512f,avx512dq,avx512cd,avx512bw,avx512vl"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CLX QT_FUNCTION_TARGET_STRING_ARCH_SKX ",avx512vnni"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CPX QT_FUNCTION_TARGET_STRING_ARCH_CLX ",avx512bf16"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CNL QT_FUNCTION_TARGET_STRING_ARCH_SKX ",avx512ifma,avx512vbmi"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ICL QT_FUNCTION_TARGET_STRING_ARCH_CNL ",avx512vbmi2,gfni,vaes,vpclmulqdq,avx512vnni,avx512bitalg,avx512vpopcntdq"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ICX QT_FUNCTION_TARGET_STRING_ARCH_ICL ",pconfig"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_TGL QT_FUNCTION_TARGET_STRING_ARCH_ICL ",avx512vp2intersect,shstk,,movdiri,movdir64b,ibt,keylocker"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SPR QT_FUNCTION_TARGET_STRING_ARCH_TGL ",avx512bf16,amxtile,amxbf16,amxint8,avxvnni,cldemote,pconfig,waitpkg,serialize,tsxldtrk,uintr"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_PLC QT_FUNCTION_TARGET_STRING_ARCH_SKX ",avx512ifma,avx512vbmi"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SNC QT_FUNCTION_TARGET_STRING_ARCH_PLC ",avx512vbmi2,gfni,vaes,vpclmulqdq,avx512vnni,avx512bitalg,avx512vpopcntdq"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_WLC QT_FUNCTION_TARGET_STRING_ARCH_SNC ",shstk,movdiri,movdir64b,ibt,keylocker"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GLC QT_FUNCTION_TARGET_STRING_ARCH_WLC ",avx512bf16,avxvnni,cldemote,waitpkg,serialize,uintr"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_RPC QT_FUNCTION_TARGET_STRING_ARCH_GLC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_RWC QT_FUNCTION_TARGET_STRING_ARCH_RPC ",prefetchiti"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SLM QT_FUNCTION_TARGET_STRING_ARCH_WSM ",rdrnd,movbe"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GLM QT_FUNCTION_TARGET_STRING_ARCH_SLM ",fsgsbase,rdseed,lzcnt,xsavec,xsaves"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_TNT QT_FUNCTION_TARGET_STRING_ARCH_GLM ",clwb,gfni,cldemote,waitpkg,movdiri,movdir64b"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GRT QT_FUNCTION_TARGET_STRING_ARCH_SKL ",avxvnni,gfni,vaes,vpclmulqdq,serialize,shstk,cldemote,movdiri,movdir64b,ibt,waitpkg,keylocker"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CMT QT_FUNCTION_TARGET_STRING_ARCH_GRT ",cmpccxadd,avxifma,avxneconvert,avxvnniint8"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CNL QT_FUNCTION_TARGET_STRING_ARCH_PLC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ICL QT_FUNCTION_TARGET_STRING_ARCH_SNC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_TGL QT_FUNCTION_TARGET_STRING_ARCH_WLC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ADL QT_FUNCTION_TARGET_STRING_ARCH_GRT
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_RPL QT_FUNCTION_TARGET_STRING_ARCH_GRT
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_MTL QT_FUNCTION_TARGET_STRING_ARCH_CMT
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ARL QT_FUNCTION_TARGET_STRING_ARCH_CMT
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_LNL QT_FUNCTION_TARGET_STRING_ARCH_CMT
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ICX QT_FUNCTION_TARGET_STRING_ARCH_SNC ",pconfig"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SPR QT_FUNCTION_TARGET_STRING_ARCH_GLC ",pconfig,amx-tile,amx-bf16,amx-int8"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_EMR QT_FUNCTION_TARGET_STRING_ARCH_SPR
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GNR QT_FUNCTION_TARGET_STRING_ARCH_GLC ",pconfig,amx-tile,amx-bf16,amx-int8,amx-fp16,amx-complex"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SRF QT_FUNCTION_TARGET_STRING_ARCH_CMT ",cmpccxadd,avxifma,avxneconvert,avxvnniint8"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GRR QT_FUNCTION_TARGET_STRING_ARCH_SRF ",raoint"
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CWF QT_FUNCTION_TARGET_STRING_ARCH_SRF
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_NEHALEM QT_FUNCTION_TARGET_STRING_ARCH_NHM
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_WESTMERE QT_FUNCTION_TARGET_STRING_ARCH_WSM
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SANDYBRIDGE QT_FUNCTION_TARGET_STRING_ARCH_SNB
|
||||
@ -212,15 +281,32 @@
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SKYLAKE_AVX512 QT_FUNCTION_TARGET_STRING_ARCH_SKX
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CASCADELAKE QT_FUNCTION_TARGET_STRING_ARCH_CLX
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_COOPERLAKE QT_FUNCTION_TARGET_STRING_ARCH_CPX
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_PALMCOVE QT_FUNCTION_TARGET_STRING_ARCH_PLC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CANNONLAKE QT_FUNCTION_TARGET_STRING_ARCH_CNL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SUNNYCOVE QT_FUNCTION_TARGET_STRING_ARCH_SNC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ICELAKE_CLIENT QT_FUNCTION_TARGET_STRING_ARCH_ICL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ICELAKE_SERVER QT_FUNCTION_TARGET_STRING_ARCH_ICX
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ALDERLAKE QT_FUNCTION_TARGET_STRING_ARCH_ADL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SAPPHIRERAPIDS QT_FUNCTION_TARGET_STRING_ARCH_SPR
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_WILLOWCOVE QT_FUNCTION_TARGET_STRING_ARCH_WLC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_TIGERLAKE QT_FUNCTION_TARGET_STRING_ARCH_TGL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GOLDENCOVE QT_FUNCTION_TARGET_STRING_ARCH_GLC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ALDERLAKE QT_FUNCTION_TARGET_STRING_ARCH_ADL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_RAPTORCOVE QT_FUNCTION_TARGET_STRING_ARCH_RPC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_RAPTORLAKE QT_FUNCTION_TARGET_STRING_ARCH_RPL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_REDWOODCOVE QT_FUNCTION_TARGET_STRING_ARCH_RWC
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_METEORLAKE QT_FUNCTION_TARGET_STRING_ARCH_MTL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_ARROWLAKE QT_FUNCTION_TARGET_STRING_ARCH_ARL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_LUNARLAKE QT_FUNCTION_TARGET_STRING_ARCH_LNL
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SAPPHIRERAPIDS QT_FUNCTION_TARGET_STRING_ARCH_SPR
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_EMERALDRAPIDS QT_FUNCTION_TARGET_STRING_ARCH_EMR
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GRANITERAPIDS QT_FUNCTION_TARGET_STRING_ARCH_GNR
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SILVERMONT QT_FUNCTION_TARGET_STRING_ARCH_SLM
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GOLDMONT QT_FUNCTION_TARGET_STRING_ARCH_GLM
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_TREMONT QT_FUNCTION_TARGET_STRING_ARCH_TNT
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GRACEMONT QT_FUNCTION_TARGET_STRING_ARCH_GRT
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CRESTMONT QT_FUNCTION_TARGET_STRING_ARCH_CMT
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_GRANDRIDGE QT_FUNCTION_TARGET_STRING_ARCH_GRR
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_SIERRAFOREST QT_FUNCTION_TARGET_STRING_ARCH_SRF
|
||||
#define QT_FUNCTION_TARGET_STRING_ARCH_CLEARWATERFOREST QT_FUNCTION_TARGET_STRING_ARCH_CWF
|
||||
|
||||
static const uint64_t _compilerCpuFeatures = 0
|
||||
#ifdef __SSE2__
|
||||
@ -295,6 +381,9 @@ static const uint64_t _compilerCpuFeatures = 0
|
||||
#ifdef __AVX512VBMI__
|
||||
| cpu_feature_avx512vbmi
|
||||
#endif
|
||||
#ifdef __WAITPKG__
|
||||
| cpu_feature_waitpkg
|
||||
#endif
|
||||
#ifdef __AVX512VBMI2__
|
||||
| cpu_feature_avx512vbmi2
|
||||
#endif
|
||||
@ -307,9 +396,6 @@ static const uint64_t _compilerCpuFeatures = 0
|
||||
#ifdef __VAES__
|
||||
| cpu_feature_vaes
|
||||
#endif
|
||||
#ifdef __AVX512VNNI__
|
||||
| cpu_feature_avx512vnni
|
||||
#endif
|
||||
#ifdef __AVX512BITALG__
|
||||
| cpu_feature_avx512bitalg
|
||||
#endif
|
||||
@ -324,6 +410,18 @@ static const uint64_t _compilerCpuFeatures = 0
|
||||
#endif
|
||||
#ifdef __AVX512FP16__
|
||||
| cpu_feature_avx512fp16
|
||||
#endif
|
||||
#ifdef __RAOINT__
|
||||
| cpu_feature_raoint
|
||||
#endif
|
||||
#ifdef __CMPCCXADD__
|
||||
| cpu_feature_cmpccxadd
|
||||
#endif
|
||||
#ifdef __AVXIFMA__
|
||||
| cpu_feature_avxifma
|
||||
#endif
|
||||
#ifdef __LAM__
|
||||
| cpu_feature_lam
|
||||
#endif
|
||||
;
|
||||
|
||||
@ -353,16 +451,20 @@ enum X86CpuFeatures : uint64_t {
|
||||
CpuFeatureAVX512BW = cpu_feature_avx512bw, ///< AVX512 Byte & Word
|
||||
CpuFeatureAVX512VL = cpu_feature_avx512vl, ///< AVX512 Vector Length
|
||||
CpuFeatureAVX512VBMI = cpu_feature_avx512vbmi, ///< AVX512 Vector Byte Manipulation Instructions
|
||||
CpuFeatureWAITPKG = cpu_feature_waitpkg, ///< User-Level Monitor / Wait
|
||||
CpuFeatureAVX512VBMI2 = cpu_feature_avx512vbmi2, ///< AVX512 Vector Byte Manipulation Instructions 2
|
||||
CpuFeatureSHSTK = cpu_feature_shstk, ///< Control Flow Enforcement Technology Shadow Stack
|
||||
CpuFeatureGFNI = cpu_feature_gfni, ///< Galois Field new instructions
|
||||
CpuFeatureVAES = cpu_feature_vaes, ///< 256- and 512-bit AES
|
||||
CpuFeatureAVX512VNNI = cpu_feature_avx512vnni, ///< AVX512 Vector Neural Network Instructions
|
||||
CpuFeatureAVX512BITALG = cpu_feature_avx512bitalg, ///< AVX512 Bit Algorithms
|
||||
CpuFeatureAVX512VPOPCNTDQ = cpu_feature_avx512vpopcntdq, ///< AVX512 Population Count
|
||||
CpuFeatureHYBRID = cpu_feature_hybrid, ///< Hybrid processor
|
||||
CpuFeatureIBT = cpu_feature_ibt, ///< Control Flow Enforcement Technology Indirect Branch Tracking
|
||||
CpuFeatureAVX512FP16 = cpu_feature_avx512fp16, ///< AVX512 16-bit Floating Point
|
||||
CpuFeatureRAOINT = cpu_feature_raoint, ///< Remote Atomic Operations, Integer
|
||||
CpuFeatureCMPCCXADD = cpu_feature_cmpccxadd, ///< CMPccXADD instructions
|
||||
CpuFeatureAVXIFMA = cpu_feature_avxifma, ///< AVX-IFMA instructions
|
||||
CpuFeatureLAM = cpu_feature_lam, ///< Linear Address Masking
|
||||
}; // enum X86CpuFeatures
|
||||
|
||||
enum X86CpuArchitectures : uint64_t {
|
||||
@ -372,22 +474,39 @@ enum X86CpuArchitectures : uint64_t {
|
||||
CpuArchWSM = cpu_wsm,
|
||||
CpuArchSNB = cpu_snb,
|
||||
CpuArchIVB = cpu_ivb,
|
||||
CpuArchHSW = cpu_hsw,
|
||||
CpuArchHSW = cpu_hsw, ///< hle,rtm
|
||||
CpuArchBDW = cpu_bdw,
|
||||
CpuArchBDX = cpu_bdx,
|
||||
CpuArchSKL = cpu_skl,
|
||||
CpuArchADL = cpu_adl,
|
||||
CpuArchSKX = cpu_skx,
|
||||
CpuArchSKX = cpu_skx, ///< clwb
|
||||
CpuArchCLX = cpu_clx,
|
||||
CpuArchCPX = cpu_cpx,
|
||||
CpuArchCNL = cpu_cnl,
|
||||
CpuArchICL = cpu_icl,
|
||||
CpuArchICX = cpu_icx,
|
||||
CpuArchTGL = cpu_tgl,
|
||||
CpuArchSPR = cpu_spr,
|
||||
CpuArchPLC = cpu_plc, ///< sha
|
||||
CpuArchSNC = cpu_snc, ///< fsrm,rdpid
|
||||
CpuArchWLC = cpu_wlc, ///< avx512vp2intersect
|
||||
CpuArchGLC = cpu_glc, ///< tsxldtrk
|
||||
CpuArchRPC = cpu_rpc,
|
||||
CpuArchRWC = cpu_rwc,
|
||||
CpuArchSLM = cpu_slm,
|
||||
CpuArchGLM = cpu_glm,
|
||||
CpuArchTNT = cpu_tnt,
|
||||
CpuArchGRT = cpu_grt, ///< rdpid
|
||||
CpuArchCMT = cpu_cmt,
|
||||
CpuArchCNL = cpu_cnl,
|
||||
CpuArchICL = cpu_icl,
|
||||
CpuArchTGL = cpu_tgl,
|
||||
CpuArchADL = cpu_adl,
|
||||
CpuArchRPL = cpu_rpl,
|
||||
CpuArchMTL = cpu_mtl,
|
||||
CpuArchARL = cpu_arl,
|
||||
CpuArchLNL = cpu_lnl,
|
||||
CpuArchICX = cpu_icx,
|
||||
CpuArchSPR = cpu_spr,
|
||||
CpuArchEMR = cpu_emr,
|
||||
CpuArchGNR = cpu_gnr,
|
||||
CpuArchSRF = cpu_srf,
|
||||
CpuArchGRR = cpu_grr,
|
||||
CpuArchCWF = cpu_cwf,
|
||||
CpuArchNehalem = cpu_nehalem, ///< Intel Core i3/i5/i7
|
||||
CpuArchWestmere = cpu_westmere, ///< Intel Core i3/i5/i7
|
||||
CpuArchSandyBridge = cpu_sandybridge, ///< Second Generation Intel Core i3/i5/i7
|
||||
@ -398,15 +517,32 @@ enum X86CpuArchitectures : uint64_t {
|
||||
CpuArchSkylakeAvx512 = cpu_skylake_avx512, ///< Intel Xeon Scalable
|
||||
CpuArchCascadeLake = cpu_cascadelake, ///< Second Generation Intel Xeon Scalable
|
||||
CpuArchCooperLake = cpu_cooperlake, ///< Third Generation Intel Xeon Scalable
|
||||
CpuArchPalmCove = cpu_palmcove,
|
||||
CpuArchCannonLake = cpu_cannonlake, ///< Intel Core i3-8121U
|
||||
CpuArchSunnyCove = cpu_sunnycove,
|
||||
CpuArchIceLakeClient = cpu_icelake_client, ///< Tenth Generation Intel Core i3/i5/i7
|
||||
CpuArchIceLakeServer = cpu_icelake_server, ///< Third Generation Intel Xeon Scalable
|
||||
CpuArchAlderLake = cpu_alderlake,
|
||||
CpuArchSapphireRapids = cpu_sapphirerapids,
|
||||
CpuArchWillowCove = cpu_willowcove,
|
||||
CpuArchTigerLake = cpu_tigerlake, ///< Eleventh Generation Intel Core i3/i5/i7
|
||||
CpuArchGoldenCove = cpu_goldencove,
|
||||
CpuArchAlderLake = cpu_alderlake, ///< Twelfth Generation Intel Core
|
||||
CpuArchRaptorCove = cpu_raptorcove,
|
||||
CpuArchRaptorLake = cpu_raptorlake, ///< Thirteenth Generation Intel Core
|
||||
CpuArchRedwoodCove = cpu_redwoodcove,
|
||||
CpuArchMeteorLake = cpu_meteorlake,
|
||||
CpuArchArrowLake = cpu_arrowlake,
|
||||
CpuArchLunarLake = cpu_lunarlake,
|
||||
CpuArchSapphireRapids = cpu_sapphirerapids, ///< Fourth Generation Intel Xeon Scalable
|
||||
CpuArchEmeraldRapids = cpu_emeraldrapids, ///< Fifth Generation Intel Xeon Scalable
|
||||
CpuArchGraniteRapids = cpu_graniterapids,
|
||||
CpuArchSilvermont = cpu_silvermont,
|
||||
CpuArchGoldmont = cpu_goldmont,
|
||||
CpuArchTremont = cpu_tremont,
|
||||
CpuArchGracemont = cpu_gracemont,
|
||||
CpuArchCrestmont = cpu_crestmont,
|
||||
CpuArchGrandRidge = cpu_grandridge,
|
||||
CpuArchSierraForest = cpu_sierraforest,
|
||||
CpuArchClearwaterForest = cpu_clearwaterforest,
|
||||
}; // enum X86cpuArchitectures
|
||||
#endif /* C++11 */
|
||||
|
||||
|
@ -352,8 +352,7 @@ static QByteArray getEtcFileFirstLine(const char *fileName)
|
||||
return QByteArray();
|
||||
|
||||
const char *ptr = buffer.constData();
|
||||
int eol = buffer.indexOf("\n");
|
||||
return QByteArray(ptr, eol).trimmed();
|
||||
return QByteArray(ptr, buffer.indexOf("\n")).trimmed();
|
||||
}
|
||||
|
||||
static bool readEtcRedHatRelease(QUnixOSVersion &v)
|
||||
@ -368,9 +367,9 @@ static bool readEtcRedHatRelease(QUnixOSVersion &v)
|
||||
v.prettyName = QString::fromLatin1(line);
|
||||
|
||||
const char keyword[] = "release ";
|
||||
int releaseIndex = line.indexOf(keyword);
|
||||
const qsizetype releaseIndex = line.indexOf(keyword);
|
||||
v.productType = QString::fromLatin1(line.mid(0, releaseIndex)).remove(u' ');
|
||||
int spaceIndex = line.indexOf(' ', releaseIndex + strlen(keyword));
|
||||
const qsizetype spaceIndex = line.indexOf(' ', releaseIndex + strlen(keyword));
|
||||
v.productVersion = QString::fromLatin1(line.mid(releaseIndex + strlen(keyword),
|
||||
spaceIndex > -1 ? spaceIndex - releaseIndex - int(strlen(keyword)) : -1));
|
||||
return true;
|
||||
@ -788,6 +787,8 @@ QString QSysInfo::productType()
|
||||
return QStringLiteral("macos");
|
||||
#elif defined(Q_OS_DARWIN)
|
||||
return QStringLiteral("darwin");
|
||||
#elif defined(Q_OS_WASM)
|
||||
return QStringLiteral("wasm");
|
||||
|
||||
#elif defined(USE_ETC_OS_RELEASE) // Q_OS_UNIX
|
||||
QUnixOSVersion unixOsVersion;
|
||||
|
@ -2,21 +2,22 @@
|
||||
// Copyright (C) 2016 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef QSYSINFO_H
|
||||
#define QSYSINFO_H
|
||||
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qprocessordetection.h>
|
||||
#include <QtCore/qtcoreexports.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*
|
||||
System information
|
||||
*/
|
||||
|
||||
#ifdef Q_QDOC
|
||||
class QByteArray;
|
||||
#endif
|
||||
class QString;
|
||||
class QByteArray;
|
||||
|
||||
class Q_CORE_EXPORT QSysInfo
|
||||
{
|
||||
public:
|
||||
|
@ -2,10 +2,6 @@
|
||||
// Copyright (C) 2019 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#ifndef QGLOBAL_H
|
||||
# include <QtCore/qglobal.h>
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#pragma qt_class(QtSystemDetection)
|
||||
#pragma qt_sync_skip_header_check
|
||||
@ -54,14 +50,10 @@
|
||||
|
||||
#if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
|
||||
# include <TargetConditionals.h>
|
||||
# define Q_OS_APPLE
|
||||
# if defined(TARGET_OS_MAC) && TARGET_OS_MAC
|
||||
# define Q_OS_DARWIN
|
||||
# define Q_OS_BSD4
|
||||
# ifdef __LP64__
|
||||
# define Q_OS_DARWIN64
|
||||
# else
|
||||
# define Q_OS_DARWIN32
|
||||
# endif
|
||||
# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||
# define QT_PLATFORM_UIKIT
|
||||
# if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH
|
||||
@ -157,92 +149,32 @@
|
||||
|
||||
// Compatibility synonyms
|
||||
#ifdef Q_OS_DARWIN
|
||||
#define Q_OS_MAC
|
||||
#endif
|
||||
#ifdef Q_OS_DARWIN32
|
||||
#define Q_OS_MAC32
|
||||
#endif
|
||||
#ifdef Q_OS_DARWIN64
|
||||
#define Q_OS_MAC64
|
||||
#endif
|
||||
#ifdef Q_OS_MACOS
|
||||
#define Q_OS_MACX
|
||||
#define Q_OS_OSX
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
# define Q_OS_MAC // FIXME: Deprecate
|
||||
# ifdef __LP64__
|
||||
# define Q_OS_DARWIN64
|
||||
# pragma clang deprecated(Q_OS_DARWIN64, "use Q_OS_DARWIN and QT_POINTER_SIZE/Q_PROCESSOR_* instead")
|
||||
# define Q_OS_MAC64
|
||||
# pragma clang deprecated(Q_OS_MAC64, "use Q_OS_DARWIN and QT_POINTER_SIZE/Q_PROCESSOR_* instead")
|
||||
# else
|
||||
# define Q_OS_DARWIN32
|
||||
# pragma clang deprecated(Q_OS_DARWIN32, "use Q_OS_DARWIN and QT_POINTER_SIZE/Q_PROCESSOR_* instead")
|
||||
# define Q_OS_MAC32
|
||||
# pragma clang deprecated(Q_OS_MAC32, "use Q_OS_DARWIN and QT_POINTER_SIZE/Q_PROCESSOR_* instead")
|
||||
# endif
|
||||
# ifdef Q_OS_MACOS
|
||||
# define Q_OS_MACX
|
||||
# pragma clang deprecated(Q_OS_MACX, "use Q_OS_MACOS instead")
|
||||
# define Q_OS_OSX
|
||||
# pragma clang deprecated(Q_OS_OSX, "use Q_OS_MACOS instead")
|
||||
# endif
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
# include <Availability.h>
|
||||
# include <AvailabilityMacros.h>
|
||||
#
|
||||
# ifdef Q_OS_MACOS
|
||||
# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
|
||||
# undef __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
# define __MAC_OS_X_VERSION_MIN_REQUIRED __MAC_10_6
|
||||
# endif
|
||||
# if !defined(MAC_OS_X_VERSION_MIN_REQUIRED) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
|
||||
# undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
|
||||
# endif
|
||||
# endif
|
||||
#
|
||||
# // Numerical checks are preferred to named checks, but to be safe
|
||||
# // we define the missing version names in case Qt uses them.
|
||||
#
|
||||
# if !defined(__MAC_10_11)
|
||||
# define __MAC_10_11 101100
|
||||
# endif
|
||||
# if !defined(__MAC_10_12)
|
||||
# define __MAC_10_12 101200
|
||||
# endif
|
||||
# if !defined(__MAC_10_13)
|
||||
# define __MAC_10_13 101300
|
||||
# endif
|
||||
# if !defined(__MAC_10_14)
|
||||
# define __MAC_10_14 101400
|
||||
# endif
|
||||
# if !defined(__MAC_10_15)
|
||||
# define __MAC_10_15 101500
|
||||
# endif
|
||||
# if !defined(__MAC_10_16)
|
||||
# define __MAC_10_16 101600
|
||||
# endif
|
||||
# if !defined(MAC_OS_X_VERSION_10_11)
|
||||
# define MAC_OS_X_VERSION_10_11 __MAC_10_11
|
||||
# endif
|
||||
# if !defined(MAC_OS_X_VERSION_10_12)
|
||||
# define MAC_OS_X_VERSION_10_12 __MAC_10_12
|
||||
# endif
|
||||
# if !defined(MAC_OS_X_VERSION_10_13)
|
||||
# define MAC_OS_X_VERSION_10_13 __MAC_10_13
|
||||
# endif
|
||||
# if !defined(MAC_OS_X_VERSION_10_14)
|
||||
# define MAC_OS_X_VERSION_10_14 __MAC_10_14
|
||||
# endif
|
||||
# if !defined(MAC_OS_X_VERSION_10_15)
|
||||
# define MAC_OS_X_VERSION_10_15 __MAC_10_15
|
||||
# endif
|
||||
# if !defined(MAC_OS_X_VERSION_10_16)
|
||||
# define MAC_OS_X_VERSION_10_16 __MAC_10_16
|
||||
# endif
|
||||
#
|
||||
# if !defined(__IPHONE_10_0)
|
||||
# define __IPHONE_10_0 100000
|
||||
# endif
|
||||
# if !defined(__IPHONE_10_1)
|
||||
# define __IPHONE_10_1 100100
|
||||
# endif
|
||||
# if !defined(__IPHONE_10_2)
|
||||
# define __IPHONE_10_2 100200
|
||||
# endif
|
||||
# if !defined(__IPHONE_10_3)
|
||||
# define __IPHONE_10_3 100300
|
||||
# endif
|
||||
# if !defined(__IPHONE_11_0)
|
||||
# define __IPHONE_11_0 110000
|
||||
# endif
|
||||
# if !defined(__IPHONE_12_0)
|
||||
# define __IPHONE_12_0 120000
|
||||
# endif
|
||||
|
||||
# define QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, tvos, watchos) \
|
||||
((defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && macos != __MAC_NA && __MAC_OS_X_VERSION_MAX_ALLOWED >= macos) || \
|
||||
@ -278,13 +210,7 @@
|
||||
# define QT_WATCHOS_DEPLOYMENT_TARGET_BELOW(watchos) \
|
||||
QT_DARWIN_DEPLOYMENT_TARGET_BELOW(__MAC_NA, __IPHONE_NA, __TVOS_NA, watchos)
|
||||
|
||||
// Compatibility synonyms, do not use
|
||||
# define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios)
|
||||
# define QT_MAC_DEPLOYMENT_TARGET_BELOW(osx, ios) QT_MACOS_IOS_DEPLOYMENT_TARGET_BELOW(osx, ios)
|
||||
# define QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(osx) QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(osx)
|
||||
# define QT_OSX_DEPLOYMENT_TARGET_BELOW(osx) QT_MACOS_DEPLOYMENT_TARGET_BELOW(osx)
|
||||
|
||||
#else
|
||||
#else // !Q_OS_DARWIN
|
||||
|
||||
#define QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, tvos, watchos) (0)
|
||||
#define QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios) (0)
|
||||
@ -293,9 +219,6 @@
|
||||
#define QT_TVOS_PLATFORM_SDK_EQUAL_OR_ABOVE(tvos) (0)
|
||||
#define QT_WATCHOS_PLATFORM_SDK_EQUAL_OR_ABOVE(watchos) (0)
|
||||
|
||||
#define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) (0)
|
||||
#define QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(osx) (0)
|
||||
|
||||
#endif // Q_OS_DARWIN
|
||||
|
||||
#ifdef __LSB_VERSION__
|
||||
|
@ -23,6 +23,16 @@
|
||||
\relates <QtSystemDetection>
|
||||
|
||||
Defined on Darwin-based operating systems such as \macos, iOS, watchOS, and tvOS.
|
||||
|
||||
\note Unless you are dealing with code specific to the Darwin kernel,
|
||||
prefer Q_OS_APPLE to refer to the family of Apple operating systems.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_OS_APPLE
|
||||
\relates <QtSystemDetection>
|
||||
|
||||
Defined on Apple operating systems such as \macos, iOS, watchOS, and tvOS.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -14,36 +14,31 @@
|
||||
// for rand_s, _CRT_RAND_S must be #defined before #including stdlib.h.
|
||||
// put it at the beginning so some indirect inclusion doesn't break it
|
||||
#ifndef _CRT_RAND_S
|
||||
#define _CRT_RAND_S
|
||||
# define _CRT_RAND_S
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <qglobal.h>
|
||||
#ifdef Q_OS_WIN
|
||||
# ifdef Q_CC_MINGW
|
||||
# ifdef Q_CC_MINGW
|
||||
// <unistd.h> must be included before any other header pulls in <time.h>.
|
||||
# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r()
|
||||
# endif
|
||||
# define _POSIX_
|
||||
# include <limits.h>
|
||||
# undef _POSIX_
|
||||
# if defined(Q_CC_CLANG) && defined(Q_CC_MSVC)
|
||||
// See https://bugs.llvm.org/show_bug.cgi?id=41226
|
||||
# include <wchar.h>
|
||||
__declspec(selectany) auto *__wmemchr_symbol_loader_value = wmemchr(L"", L'0', 0);
|
||||
# endif
|
||||
# endif
|
||||
# include <qcoreapplication.h>
|
||||
# include <qcoreevent.h>
|
||||
# include <qiodevice.h>
|
||||
# include <qlist.h>
|
||||
# include <qvariant.h> /* All moc generated code has this include */
|
||||
# include <qobject.h>
|
||||
# if QT_CONFIG(regularexpression)
|
||||
# include <qregularexpression.h>
|
||||
# endif
|
||||
# include <qscopedpointer.h>
|
||||
# include <qshareddata.h>
|
||||
# include <qstring.h>
|
||||
# include <qstringlist.h>
|
||||
# include <qtimer.h>
|
||||
# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r()
|
||||
# endif // Q_CC_MINGW
|
||||
# define _POSIX_
|
||||
# include <limits.h>
|
||||
# undef _POSIX_
|
||||
#endif // Q_OS_WIN
|
||||
#include <qcoreapplication.h>
|
||||
#include <qcoreevent.h>
|
||||
#include <qiodevice.h>
|
||||
#include <qlist.h>
|
||||
#include <qvariant.h> /* All moc generated code has this include */
|
||||
#include <qobject.h>
|
||||
#if QT_CONFIG(regularexpression)
|
||||
# include <qregularexpression.h>
|
||||
#endif
|
||||
#include <qscopedpointer.h>
|
||||
#include <qshareddata.h>
|
||||
#include <qstring.h>
|
||||
#include <qstringlist.h>
|
||||
#include <qtimer.h>
|
||||
#endif
|
||||
|
22
src/corelib/global/qtconfiginclude.h
Normal file
22
src/corelib/global/qtconfiginclude.h
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2022 Intel Corporation
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#ifndef QTCONFIGINCLUDE_H
|
||||
#define QTCONFIGINCLUDE_H
|
||||
|
||||
#if 0
|
||||
# pragma qt_sync_stop_processing
|
||||
#endif
|
||||
|
||||
#include <QtCore/qconfig.h>
|
||||
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
// qconfig-bootstrapped.h is not supposed to be a part of the synced header files. So we find it by
|
||||
// the include path specified for Bootstrap library in the source tree instead of the build tree as
|
||||
// it's done for regular header files.
|
||||
#include "qconfig-bootstrapped.h"
|
||||
#else
|
||||
#include <QtCore/qtcore-config.h>
|
||||
#endif
|
||||
|
||||
#endif // QTCONFIGINCLUDE_H
|
@ -7,15 +7,10 @@
|
||||
#if 0
|
||||
# pragma qt_sync_stop_processing
|
||||
#endif
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
// qconfig-bootstrapped.h is not supposed to be a part of the synced header files. So we find it by
|
||||
// the include path specified for Bootstrap library in the source tree instead of the build tree as
|
||||
// it's done for regular header files.
|
||||
#include "qconfig-bootstrapped.h"
|
||||
#else
|
||||
#include <QtCore/qconfig.h>
|
||||
#include <QtCore/qtcore-config.h>
|
||||
#endif
|
||||
|
||||
#include <QtCore/qtconfiginclude.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
/*
|
||||
The Qt modules' export macros.
|
||||
@ -65,7 +60,7 @@
|
||||
1: The feature is available
|
||||
*/
|
||||
#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
|
||||
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
|
||||
#define QT_REQUIRE_CONFIG(feature) static_assert(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
|
||||
|
||||
/* moc compats (signals/slots) */
|
||||
#ifndef QT_MOC_COMPAT
|
||||
|
@ -203,6 +203,14 @@ QT_BEGIN_NAMESPACE
|
||||
# define QT_DEPRECATED_VERSION_6_9
|
||||
#endif
|
||||
|
||||
#if QT_WARN_DEPRECATED_UP_TO >= QT_VERSION_CHECK(6, 10, 0)
|
||||
# define QT_DEPRECATED_VERSION_X_6_10(text) QT_DEPRECATED_X(text)
|
||||
# define QT_DEPRECATED_VERSION_6_10 QT_DEPRECATED
|
||||
#else
|
||||
# define QT_DEPRECATED_VERSION_X_6_10(text)
|
||||
# define QT_DEPRECATED_VERSION_6_10
|
||||
#endif
|
||||
|
||||
#define QT_DEPRECATED_VERSION_X_5(minor, text) QT_DEPRECATED_VERSION_X_5_##minor(text)
|
||||
#define QT_DEPRECATED_VERSION_X(major, minor, text) QT_DEPRECATED_VERSION_X_##major##_##minor(text)
|
||||
|
||||
@ -299,6 +307,12 @@ QT_BEGIN_NAMESPACE
|
||||
# define QT_IF_DEPRECATED_SINCE_6_9(whenTrue, whenFalse) whenTrue
|
||||
#endif
|
||||
|
||||
#if QT_DEPRECATED_SINCE(6, 10)
|
||||
# define QT_IF_DEPRECATED_SINCE_6_10(whenTrue, whenFalse) whenFalse
|
||||
#else
|
||||
# define QT_IF_DEPRECATED_SINCE_6_10(whenTrue, whenFalse) whenTrue
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
// A tag to help mark stuff deprecated (cf. QStringViewLiteral)
|
||||
namespace QtPrivate {
|
||||
|
@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#include "qtenvironmentvariables.h"
|
||||
#include "qtenvironmentvariables_p.h"
|
||||
|
||||
#include <qplatformdefs.h>
|
||||
#include <QtCore/qbytearray.h>
|
||||
@ -330,9 +331,11 @@ bool qunsetenv(const char *varName)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
Wraps tzset(), which accesses the environment, so should only be called while
|
||||
we hold the lock on the environment mutex.
|
||||
/* Various time-related APIs that need to consult system settings also need
|
||||
protection with the same lock as the environment, since those system settings
|
||||
include part of the environment (principally TZ).
|
||||
|
||||
First, tzset(), which POSIX explicitly says accesses the environment.
|
||||
*/
|
||||
void qTzSet()
|
||||
{
|
||||
@ -344,9 +347,8 @@ void qTzSet()
|
||||
#endif // Q_OS_WIN
|
||||
}
|
||||
|
||||
/*
|
||||
Wrap mktime(), which is specified to behave as if it called tzset(), hence
|
||||
shares its implicit environment-dependence.
|
||||
/* Wrap mktime(), which is specified to behave as if it called tzset(), hence
|
||||
shares its implicit environment-dependence.
|
||||
*/
|
||||
time_t qMkTime(struct tm *when)
|
||||
{
|
||||
@ -354,4 +356,70 @@ time_t qMkTime(struct tm *when)
|
||||
return mktime(when);
|
||||
}
|
||||
|
||||
/* For localtime(), POSIX mandates that it behave as if it called tzset().
|
||||
For the alternatives to it, we need (if only for compatibility) to do the
|
||||
same explicitly, which should ensure a re-parse of timezone info.
|
||||
*/
|
||||
bool qLocalTime(time_t utc, struct tm *local)
|
||||
{
|
||||
const auto locker = qt_scoped_lock(environmentMutex);
|
||||
#if defined(Q_OS_WIN)
|
||||
// The doc of localtime_s() says that it corrects for the same things
|
||||
// _tzset() sets the globals for, but QTBUG-109974 reveals a need for an
|
||||
// explicit call, all the same.
|
||||
_tzset();
|
||||
return !localtime_s(local, &utc);
|
||||
#elif QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
|
||||
// Use the reentrant version of localtime() where available, as it is
|
||||
// thread-safe and doesn't use a shared static data area.
|
||||
// As localtime_r() is not specified to work as if it called tzset(),
|
||||
// make an explicit call.
|
||||
tzset();
|
||||
if (tm *res = localtime_r(&utc, local)) {
|
||||
Q_ASSERT(res == local);
|
||||
Q_UNUSED(res);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
// POSIX mandates that localtime() behaves as if it called tzset().
|
||||
// Returns shared static data which may be overwritten at any time (albeit
|
||||
// our lock probably keeps it safe). So copy the result promptly:
|
||||
if (tm *res = localtime(&utc)) {
|
||||
*local = *res;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Access to the tzname[] global in one thread is UB if any other is calling
|
||||
tzset() or anything that behaves as if it called tzset(). So also lock this
|
||||
access to prevent such collisions.
|
||||
|
||||
Parameter dstIndex must be 1 for DST or 0 for standard time.
|
||||
Returns the relevant form of the name of local-time's zone.
|
||||
*/
|
||||
QString qTzName(int dstIndex)
|
||||
{
|
||||
char name[512];
|
||||
bool ok;
|
||||
#if defined(Q_CC_MSVC)
|
||||
size_t s = 0;
|
||||
{
|
||||
const auto locker = qt_scoped_lock(environmentMutex);
|
||||
ok = _get_tzname(&s, name, 512, dstIndex) != 0;
|
||||
}
|
||||
#else
|
||||
{
|
||||
const auto locker = qt_scoped_lock(environmentMutex);
|
||||
const char *const src = tzname[dstIndex];
|
||||
ok = src != nullptr;
|
||||
if (ok)
|
||||
memcpy(name, src, std::min(sizeof(name), strlen(src) + 1));
|
||||
}
|
||||
#endif // Q_OS_WIN
|
||||
return ok ? QString::fromLocal8Bit(name) : QString();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
39
src/corelib/global/qtenvironmentvariables_p.h
Normal file
39
src/corelib/global/qtenvironmentvariables_p.h
Normal file
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2017 The Qt Company Ltd.
|
||||
// Copyright (C) 2015 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#ifndef QTENVIRONMENTVARIABLES_P_H
|
||||
#define QTENVIRONMENTVARIABLES_P_H
|
||||
// Nothing but (tests and) ../time/qlocaltime.cpp should access this.
|
||||
#if defined(__cplusplus)
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. It exists purely as an implementation
|
||||
// detail. This header file may change from version to version without notice,
|
||||
// or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include "qglobal_p.h"
|
||||
|
||||
#ifdef Q_CC_MINGW
|
||||
# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r()
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
// These (behave as if they) consult the environment, so need to share its locking:
|
||||
Q_CORE_EXPORT void qTzSet();
|
||||
Q_CORE_EXPORT time_t qMkTime(struct tm *when);
|
||||
Q_CORE_EXPORT bool qLocalTime(time_t utc, struct tm *local);
|
||||
Q_CORE_EXPORT QString qTzName(int dstIndex);
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // defined(__cplusplus)
|
||||
#endif // QTENVIRONMENTVARIABLES_P_H
|
@ -5,6 +5,7 @@
|
||||
#define QTTYPETRAITS_H
|
||||
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qtdeprecationmarkers.h>
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
@ -24,16 +25,21 @@ constexpr std::underlying_type_t<Enum> qToUnderlying(Enum e) noexcept
|
||||
}
|
||||
|
||||
#ifndef QT_NO_AS_CONST
|
||||
#if QT_DEPRECATED_SINCE(6, 6)
|
||||
|
||||
// this adds const to non-const objects (like std::as_const)
|
||||
template <typename T>
|
||||
QT_DEPRECATED_VERSION_X_6_6("Use std::as_const() instead.")
|
||||
constexpr typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
|
||||
// prevent rvalue arguments:
|
||||
template <typename T>
|
||||
void qAsConst(const T &&) = delete;
|
||||
|
||||
#endif // QT_DEPRECATED_SINCE(6, 6)
|
||||
#endif // QT_NO_AS_CONST
|
||||
|
||||
#ifndef QT_NO_QEXCHANGE
|
||||
|
||||
// like std::exchange
|
||||
template <typename T, typename U = T>
|
||||
constexpr T qExchange(T &t, U &&newValue)
|
||||
@ -45,6 +51,8 @@ noexcept(std::conjunction_v<std::is_nothrow_move_constructible<T>,
|
||||
return old;
|
||||
}
|
||||
|
||||
#endif // QT_NO_QEXCHANGE
|
||||
|
||||
namespace QtPrivate {
|
||||
// helper to be used to trigger a "dependent static_assert(false)"
|
||||
// (for instance, in a final `else` branch of a `if constexpr`.)
|
||||
|
@ -15,6 +15,8 @@
|
||||
\relates <QtTypeTraits>
|
||||
\since 5.7
|
||||
|
||||
\deprecated [6.6] Use std::as_const() instead.
|
||||
|
||||
Returns \a t cast to \c{const T}.
|
||||
|
||||
This function is a Qt implementation of C++17's std::as_const(),
|
||||
@ -52,6 +54,8 @@
|
||||
\since 5.7
|
||||
\overload
|
||||
|
||||
\deprecated [6.6]
|
||||
|
||||
This overload is deleted to prevent a dangling reference in code like
|
||||
\snippet code/src_corelib_global_qglobal.cpp as-const-4
|
||||
*/
|
||||
|
@ -9,15 +9,7 @@
|
||||
#pragma qt_sync_stop_processing
|
||||
#endif
|
||||
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
// qconfig-bootstrapped.h is not supposed to be a part of the synced header files. So we find it by
|
||||
// the include path specified for Bootstrap library in the source tree instead of the build tree as
|
||||
// it's done for regular header files.
|
||||
#include "qconfig-bootstrapped.h"
|
||||
#else
|
||||
#include <QtCore/qconfig.h>
|
||||
#include <QtCore/qtcore-config.h>
|
||||
#endif
|
||||
#include <QtCore/qtconfiginclude.h>
|
||||
|
||||
/*
|
||||
QT_VERSION is (major << 16) | (minor << 8) | patch.
|
||||
@ -36,7 +28,7 @@
|
||||
void QT7_ONLY(Q_CORE_EXPORT) void operate();
|
||||
}
|
||||
*/
|
||||
#if QT_VERSION_MAJOR == 7
|
||||
#if QT_VERSION_MAJOR == 7 || defined(QT_BOOTSTRAPPED)
|
||||
# define QT7_ONLY(...) __VA_ARGS__
|
||||
# define QT6_ONLY(...)
|
||||
#elif QT_VERSION_MAJOR == 6
|
||||
|
@ -2,15 +2,16 @@
|
||||
// Copyright (C) 2016 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#ifndef QTYPEINFO_H
|
||||
#define QTYPEINFO_H
|
||||
|
||||
#include <QtCore/qcompilerdetection.h>
|
||||
#include <QtCore/qcontainerfwd.h>
|
||||
|
||||
#include <variant>
|
||||
#include <optional>
|
||||
#include <tuple>
|
||||
|
||||
#ifndef QTYPEINFO_H
|
||||
#define QTYPEINFO_H
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QDebug;
|
||||
@ -45,8 +46,8 @@ class QTypeInfo
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
isPointer = std::is_pointer_v<T>,
|
||||
isIntegral = std::is_integral_v<T>,
|
||||
isPointer [[deprecated("Use std::is_pointer instead")]] = std::is_pointer_v<T>,
|
||||
isIntegral [[deprecated("Use std::is_integral instead")]] = std::is_integral_v<T>,
|
||||
isComplex = !std::is_trivial_v<T>,
|
||||
isRelocatable = QtPrivate::qIsRelocatable<T>,
|
||||
isValueInitializationBitwiseZero = QtPrivate::qIsValueInitializationBitwiseZero<T>,
|
||||
@ -58,8 +59,8 @@ class QTypeInfo<void>
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
isPointer = false,
|
||||
isIntegral = false,
|
||||
isPointer [[deprecated("Use std::is_pointer instead")]] = false,
|
||||
isIntegral [[deprecated("Use std::is_integral instead")]] = false,
|
||||
isComplex = false,
|
||||
isRelocatable = false,
|
||||
isValueInitializationBitwiseZero = false,
|
||||
@ -93,8 +94,8 @@ class QTypeInfoMerger
|
||||
public:
|
||||
static constexpr bool isComplex = ((QTypeInfo<Ts>::isComplex) || ...);
|
||||
static constexpr bool isRelocatable = ((QTypeInfo<Ts>::isRelocatable) && ...);
|
||||
static constexpr bool isPointer = false;
|
||||
static constexpr bool isIntegral = false;
|
||||
[[deprecated("Use std::is_pointer instead")]] static constexpr bool isPointer = false;
|
||||
[[deprecated("Use std::is_integral instead")]] static constexpr bool isIntegral = false;
|
||||
static constexpr bool isValueInitializationBitwiseZero = false;
|
||||
};
|
||||
|
||||
@ -110,8 +111,8 @@ class QTypeInfo<CONTAINER<T...>> \
|
||||
{ \
|
||||
public: \
|
||||
enum { \
|
||||
isPointer = false, \
|
||||
isIntegral = false, \
|
||||
isPointer [[deprecated("Use std::is_pointer instead")]] = false, \
|
||||
isIntegral [[deprecated("Use std::is_integral instead")]] = false, \
|
||||
isComplex = true, \
|
||||
isRelocatable = true, \
|
||||
isValueInitializationBitwiseZero = false, \
|
||||
@ -153,8 +154,8 @@ public: \
|
||||
enum { \
|
||||
isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0) && !std::is_trivial_v<TYPE>, \
|
||||
isRelocatable = !isComplex || ((FLAGS) & Q_RELOCATABLE_TYPE) || QtPrivate::qIsRelocatable<TYPE>, \
|
||||
isPointer = std::is_pointer_v< TYPE >, \
|
||||
isIntegral = std::is_integral< TYPE >::value, \
|
||||
isPointer [[deprecated("Use std::is_pointer instead")]] = std::is_pointer_v< TYPE >, \
|
||||
isIntegral [[deprecated("Use std::is_integral instead")]] = std::is_integral< TYPE >::value, \
|
||||
isValueInitializationBitwiseZero = QtPrivate::qIsValueInitializationBitwiseZero<TYPE>, \
|
||||
}; \
|
||||
}
|
||||
|
@ -144,6 +144,43 @@ QT_BEGIN_NAMESPACE
|
||||
\sa Q_UINT64_C(), qint64, qulonglong
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef qint128
|
||||
\relates <QtTypes>
|
||||
\since 6.6
|
||||
|
||||
Typedef for \c{__int128} on platforms that support it (Qt defines the macro
|
||||
\l QT_SUPPORTS_INT128 if this is the case).
|
||||
|
||||
Literals of this type can be created using the Q_INT128_C() macro.
|
||||
|
||||
\sa Q_INT128_C(), Q_INT128_MIN, Q_INT128_MAX, quint128, QT_SUPPORTS_INT128
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef quint128
|
||||
\relates <QtTypes>
|
||||
\since 6.6
|
||||
|
||||
Typedef for \c{unsigned __int128} on platforms that support it (Qt defines
|
||||
the macro \l QT_SUPPORTS_INT128 if this is the case).
|
||||
|
||||
Literals of this type can be created using the Q_UINT128_C() macro.
|
||||
|
||||
\sa Q_UINT128_C(), Q_UINT128_MAX, qint128, QT_SUPPORTS_INT128
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro QT_SUPPORTS_INT128
|
||||
\relates <QtTypes>
|
||||
\since 6.6
|
||||
|
||||
Qt defines this macro as well as the \l qint128 and \l quint128 types if
|
||||
the platform has support for 128-bit integer types.
|
||||
|
||||
\sa qint128, quint128, Q_INT128_C(), Q_UINT128_C(), Q_INT128_MIN, Q_INT128_MAX, Q_UINT128_MAX
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef qintptr
|
||||
\relates <QtTypes>
|
||||
@ -327,7 +364,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
\snippet code/src_corelib_global_qglobal.cpp 8
|
||||
|
||||
\sa qint64, Q_UINT64_C()
|
||||
\sa qint64, Q_UINT64_C(), Q_INT128_C()
|
||||
*/
|
||||
|
||||
/*! \macro quint64 Q_UINT64_C(literal)
|
||||
@ -340,7 +377,79 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
\snippet code/src_corelib_global_qglobal.cpp 9
|
||||
|
||||
\sa quint64, Q_INT64_C()
|
||||
\sa quint64, Q_INT64_C(), Q_UINT128_C()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro qint128 Q_INT128_C(literal)
|
||||
\relates <QtTypes>
|
||||
\since 6.6
|
||||
|
||||
Wraps the signed 128-bit integer \a literal in a
|
||||
platform-independent way.
|
||||
|
||||
\note Unlike Q_INT64_C(), this macro is only available in C++, not in C.
|
||||
This is because compilers do not provide these literals as built-ins and C
|
||||
does not have support for user-defined literals.
|
||||
|
||||
\sa qint128, Q_UINT128_C(), Q_INT128_MIN, Q_INT128_MAX, Q_INT64_C(), QT_SUPPORTS_INT128
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro quint128 Q_UINT128_C(literal)
|
||||
\relates <QtTypes>
|
||||
\since 6.6
|
||||
|
||||
Wraps the unsigned 128-bit integer \a literal in a
|
||||
platform-independent way.
|
||||
|
||||
\note Unlike Q_UINT64_C(), this macro is only available in C++, not in C.
|
||||
This is because compilers do not provide these literals as built-ins and C
|
||||
does not have support for user-defined literals.
|
||||
|
||||
\sa quint128, Q_INT128_C(), Q_UINT128_MAX, Q_UINT64_C(), QT_SUPPORTS_INT128
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_UINT128_MAX
|
||||
\relates <QtTypes>
|
||||
\since 6.6
|
||||
|
||||
This macro expands to a compile-time constant representing the
|
||||
maximum value representable in a \l quint128.
|
||||
|
||||
This macro is available in both C++ and C modes.
|
||||
|
||||
The minimum of \l quint128 is 0 (zero), so a \c{Q_UINT128_MIN} is neither
|
||||
needed nor provided.
|
||||
|
||||
\sa Q_INT128_MAX, quint128, Q_UINT128_C, QT_SUPPORTS_INT128
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_INT128_MIN
|
||||
\relates <QtTypes>
|
||||
\since 6.6
|
||||
|
||||
This macro expands to a compile-time constant representing the
|
||||
minimum value representable in a \l qint128.
|
||||
|
||||
This macro is available in both C++ and C modes.
|
||||
|
||||
\sa Q_INT128_MAX, qint128, Q_INT128_C, QT_SUPPORTS_INT128
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_INT128_MAX
|
||||
\relates <QtTypes>
|
||||
\since 6.6
|
||||
|
||||
This macro expands to a compile-time constant representing the
|
||||
maximum value representable in a \l qint128.
|
||||
|
||||
This macro is available in both C++ and C modes.
|
||||
|
||||
\sa Q_INT128_MIN, Q_UINT128_MAX, qint128, Q_INT128_C, QT_SUPPORTS_INT128
|
||||
*/
|
||||
|
||||
// Statically check assumptions about the environment we're running
|
||||
@ -399,5 +508,18 @@ static_assert(sizeof(qint8) == 1, "Internal error, qint8 is misdefined");
|
||||
static_assert(sizeof(qint16)== 2, "Internal error, qint16 is misdefined");
|
||||
static_assert(sizeof(qint32) == 4, "Internal error, qint32 is misdefined");
|
||||
static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
|
||||
#ifdef QT_SUPPORTS_INT128
|
||||
static_assert(sizeof(qint128) == 16, "Internal error, qint128 is misdefined");
|
||||
#endif
|
||||
|
||||
#ifdef QT_SUPPORTS_INT128
|
||||
// check that numeric_limits works:
|
||||
// This fails here for GCC 9, but succeeds on Clang and GCC >= 11
|
||||
// However, all tests in tst_qglobal::int128Literals() pass for GCC 9, too,
|
||||
// so just suppress the check for older GCC:
|
||||
# if !defined(Q_CC_GNU_ONLY) || Q_CC_GNU >= 1100
|
||||
static_assert(std::numeric_limits<quint128>::max() == Q_UINT128_MAX);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -7,10 +7,13 @@
|
||||
|
||||
#include <QtCore/qprocessordetection.h>
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qassert.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
# include <cstddef>
|
||||
# include <cstdint>
|
||||
#else
|
||||
# include <assert.h>
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
@ -19,8 +22,6 @@
|
||||
#pragma qt_sync_stop_processing
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
/*
|
||||
Useful type definitions for Qt
|
||||
*/
|
||||
@ -58,9 +59,104 @@ typedef unsigned long long quint64; /* 64 bit unsigned */
|
||||
typedef qint64 qlonglong;
|
||||
typedef quint64 qulonglong;
|
||||
|
||||
#if defined(__SIZEOF_INT128__) && !defined(QT_NO_INT128)
|
||||
# define QT_SUPPORTS_INT128 __SIZEOF_INT128__
|
||||
#else
|
||||
# undef QT_SUPPORTS_INT128
|
||||
#endif
|
||||
|
||||
#if defined(QT_SUPPORTS_INT128)
|
||||
__extension__ typedef __int128_t qint128;
|
||||
__extension__ typedef __uint128_t quint128;
|
||||
|
||||
// limits:
|
||||
# ifdef __cplusplus /* need to avoid c-style-casts in C++ mode */
|
||||
# define QT_C_STYLE_CAST(type, x) static_cast<type>(x)
|
||||
# else /* but C doesn't have constructor-style casts */
|
||||
# define QT_C_STYLE_CAST(type, x) ((type)x)
|
||||
# endif
|
||||
# ifndef Q_UINT128_MAX /* allow qcompilerdetection.h/user override */
|
||||
# define Q_UINT128_MAX QT_C_STYLE_CAST(quint128, -1)
|
||||
# endif
|
||||
# define Q_INT128_MAX QT_C_STYLE_CAST(qint128, (Q_UINT128_MAX / 2))
|
||||
# define Q_INT128_MIN (-Q_INT128_MAX - 1)
|
||||
|
||||
# ifdef __cplusplus
|
||||
namespace QtPrivate::NumberLiterals {
|
||||
namespace detail {
|
||||
template <quint128 accu, int base>
|
||||
constexpr quint128 construct() { return accu; }
|
||||
|
||||
template <quint128 accu, int base, char C, char...Cs>
|
||||
constexpr quint128 construct()
|
||||
{
|
||||
if constexpr (C != '\'') { // ignore digit separators
|
||||
const int digitValue = '0' <= C && C <= '9' ? C - '0' :
|
||||
'a' <= C && C <= 'z' ? C - 'a' + 10 :
|
||||
'A' <= C && C <= 'Z' ? C - 'A' + 10 :
|
||||
/* else */ -1 ;
|
||||
static_assert(digitValue >= 0 && digitValue < base,
|
||||
"Invalid character");
|
||||
// accu * base + digitValue <= MAX, but without overflow:
|
||||
static_assert(accu <= (Q_UINT128_MAX - digitValue) / base,
|
||||
"Overflow occurred");
|
||||
return construct<accu * base + digitValue, base, Cs...>();
|
||||
} else {
|
||||
return construct<accu, base, Cs...>();
|
||||
}
|
||||
}
|
||||
|
||||
template <char C, char...Cs>
|
||||
constexpr quint128 parse0xb()
|
||||
{
|
||||
constexpr quint128 accu = 0;
|
||||
if constexpr (C == 'x' || C == 'X')
|
||||
return construct<accu, 16, Cs...>(); // base 16, skip 'x'
|
||||
else if constexpr (C == 'b' || C == 'B')
|
||||
return construct<accu, 2, Cs...>(); // base 2, skip 'b'
|
||||
else
|
||||
return construct<accu, 8, C, Cs...>(); // base 8, include C
|
||||
}
|
||||
|
||||
template <char...Cs>
|
||||
constexpr quint128 parse0()
|
||||
{
|
||||
if constexpr (sizeof...(Cs) == 0) // this was just a literal 0
|
||||
return 0;
|
||||
else
|
||||
return parse0xb<Cs...>();
|
||||
}
|
||||
|
||||
template <char C, char...Cs>
|
||||
constexpr quint128 parse()
|
||||
{
|
||||
if constexpr (C == '0')
|
||||
return parse0<Cs...>(); // base 2, 8, or 16 (or just a literal 0), skip '0'
|
||||
else
|
||||
return construct<0, 10, C, Cs...>(); // initial accu 0, base 10, include C
|
||||
}
|
||||
} // namespace detail
|
||||
template <char...Cs>
|
||||
constexpr quint128 operator""_quint128() noexcept
|
||||
{ return QtPrivate::NumberLiterals::detail::parse<Cs...>(); }
|
||||
template <char...Cs>
|
||||
constexpr qint128 operator""_qint128() noexcept
|
||||
{ return qint128(QtPrivate::NumberLiterals::detail::parse<Cs...>()); }
|
||||
|
||||
#ifndef Q_UINT128_C // allow qcompilerdetection.h/user override
|
||||
# define Q_UINT128_C(c) ([]{ using namespace QtPrivate::NumberLiterals; return c ## _quint128; }())
|
||||
#endif
|
||||
#ifndef Q_INT128_C // allow qcompilerdetection.h/user override
|
||||
# define Q_INT128_C(c) ([]{ using namespace QtPrivate::NumberLiterals; return c ## _qint128; }())
|
||||
#endif
|
||||
|
||||
} // namespace QtPrivate::NumberLiterals
|
||||
# endif // __cplusplus
|
||||
#endif // QT_SUPPORTS_INT128
|
||||
|
||||
#ifndef __cplusplus
|
||||
// In C++ mode, we define below using QIntegerForSize template
|
||||
Q_STATIC_ASSERT_X(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions");
|
||||
static_assert(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions");
|
||||
typedef ptrdiff_t qptrdiff;
|
||||
typedef ptrdiff_t qsizetype;
|
||||
typedef ptrdiff_t qintptr;
|
||||
@ -102,8 +198,8 @@ template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qin
|
||||
template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; };
|
||||
template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; };
|
||||
template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; };
|
||||
#if defined(Q_CC_GNU) && defined(__SIZEOF_INT128__)
|
||||
template <> struct QIntegerForSize<16> { __extension__ typedef unsigned __int128 Unsigned; __extension__ typedef __int128 Signed; };
|
||||
#if defined(QT_SUPPORTS_INT128)
|
||||
template <> struct QIntegerForSize<16> { typedef quint128 Unsigned; typedef qint128 Signed; };
|
||||
#endif
|
||||
template <class T> struct QIntegerForSizeof: QIntegerForSize<sizeof(T)> { };
|
||||
typedef QIntegerForSize<Q_PROCESSOR_WORDSIZE>::Signed qregisterint;
|
||||
@ -158,6 +254,4 @@ using qsizetype = QIntegerForSizeof<std::size_t>::Signed;
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // __ASSEMBLER__
|
||||
|
||||
#endif // QTYPES_H
|
||||
|
@ -1,12 +1,14 @@
|
||||
// Copyright (C) 2022 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
// qglobal.h includes this header, so keep it outside of our include guards
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if !defined(QVERSIONTAGGING_H)
|
||||
#define QVERSIONTAGGING_H
|
||||
|
||||
#include <QtCore/qcompilerdetection.h>
|
||||
#include <QtCore/qtconfigmacros.h>
|
||||
#include <QtCore/qtversionchecks.h>
|
||||
#include <QtCore/qtypes.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*
|
||||
@ -86,7 +88,7 @@ struct QVersionTag
|
||||
// Calling convention on other architectures does not prepend a _
|
||||
# define QT_MANGLE_IMPORT_PREFIX __imp_
|
||||
# endif
|
||||
# ifdef Q_CC_MSVC
|
||||
# if defined(Q_CC_MSVC_ONLY)
|
||||
# pragma section(".qtversion",read,shared)
|
||||
# define QT_VERSION_TAG_SECTION __declspec(allocate(".qtversion"))
|
||||
# define QT_VERSION_TAG_ATTRIBUTE __declspec(selectany) extern const
|
||||
|
@ -225,6 +225,8 @@ QAbstractFileEngine *QAbstractFileEngine::create(const QString &fileName)
|
||||
the base name).
|
||||
\value AbsoluteLinkTarget The full file name of the file that this file is a
|
||||
link to. (This will be empty if this file is not a link.)
|
||||
\value RawLinkPath The raw link path of the file that this file is a
|
||||
link to. (This will be empty if this file is not a link.)
|
||||
\value CanonicalName Often very similar to AbsoluteLinkTarget. Will return the true path to the file.
|
||||
\value CanonicalPathName Same as CanonicalName, excluding the base name.
|
||||
\value BundleName Returns the name of the bundle implies BundleType is set.
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
CanonicalPathName,
|
||||
BundleName,
|
||||
JunctionName,
|
||||
RawLinkPath,
|
||||
NFileNames // Must be last.
|
||||
};
|
||||
enum FileOwner {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user