diff options
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 22 | ||||
-rw-r--r-- | src/corelib/global/qflags.h | 4 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 96 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 12 | ||||
-rw-r--r-- | src/corelib/global/qlogging.cpp | 4 | ||||
-rw-r--r-- | src/corelib/global/qnumeric_p.h | 2 | ||||
-rw-r--r-- | src/corelib/global/qsysinfo.h | 10 | ||||
-rw-r--r-- | src/corelib/global/qsystemdetection.h | 7 | ||||
-rw-r--r-- | src/corelib/global/qt_windows.h | 4 |
9 files changed, 60 insertions, 101 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 86d027eb35..9a61efd1b2 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1059,16 +1059,18 @@ # define Q_COMPILER_DEFAULT_DELETE_MEMBERS #endif -#if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304 -# define Q_DECL_CONSTEXPR constexpr -# define Q_DECL_RELAXED_CONSTEXPR constexpr -# define Q_CONSTEXPR constexpr -# define Q_RELAXED_CONSTEXPR constexpr -#elif defined Q_COMPILER_CONSTEXPR -# define Q_DECL_CONSTEXPR constexpr -# define Q_DECL_RELAXED_CONSTEXPR -# define Q_CONSTEXPR constexpr -# define Q_RELAXED_CONSTEXPR const +#if defined Q_COMPILER_CONSTEXPR +# if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304 +# define Q_DECL_CONSTEXPR constexpr +# define Q_DECL_RELAXED_CONSTEXPR constexpr +# define Q_CONSTEXPR constexpr +# define Q_RELAXED_CONSTEXPR constexpr +# else +# define Q_DECL_CONSTEXPR constexpr +# define Q_DECL_RELAXED_CONSTEXPR +# define Q_CONSTEXPR constexpr +# define Q_RELAXED_CONSTEXPR const +# endif #else # define Q_DECL_CONSTEXPR # define Q_DECL_RELAXED_CONSTEXPR diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index b907caa9b6..f3082a1e39 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -111,8 +111,8 @@ public: typedef Enum enum_type; // compiler-generated copy/move ctor/assignment operators are fine! #ifdef Q_QDOC - inline QFlags(const QFlags &other); - inline QFlags &operator=(const QFlags &other); + Q_DECL_CONSTEXPR inline QFlags(const QFlags &other); + Q_DECL_CONSTEXPR inline QFlags &operator=(const QFlags &other); #endif Q_DECL_CONSTEXPR inline QFlags(Enum f) Q_DECL_NOTHROW : i(Int(f)) {} Q_DECL_CONSTEXPR inline QFlags(Zero = Q_NULLPTR) Q_DECL_NOTHROW : i(0) {} diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index bf6db53040..96a31e4167 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -64,11 +64,9 @@ # include <exception> #endif -#if !defined(Q_OS_WINCE) -# include <errno.h> -# if defined(Q_CC_MSVC) -# include <crtdbg.h> -# endif +#include <errno.h> +#if defined(Q_CC_MSVC) +# include <crtdbg.h> #endif #ifdef Q_OS_WINRT @@ -573,11 +571,11 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in \snippet code/src_corelib_global_qglobal.cpp 4 The remaining functions are qRound() and qRound64(), which both - accept a \l qreal value as their argument returning the value - rounded up to the nearest integer and 64-bit integer respectively, - the qInstallMessageHandler() function which installs the given - QtMessageHandler, and the qVersion() function which returns the - version number of Qt at run-time as a string. + accept a \c double or \c float value as their argument returning + the value rounded up to the nearest integer and 64-bit integer + respectively, the qInstallMessageHandler() function which installs + the given QtMessageHandler, and the qVersion() function which + returns the version number of Qt at run-time as a string. \section1 Macros @@ -864,24 +862,44 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in \snippet code/src_corelib_global_qglobal.cpp 10 */ -/*! \fn int qRound(qreal value) +/*! \fn int qRound(double value) + \relates <QtGlobal> + + Rounds \a value to the nearest integer. + + Example: + + \snippet code/src_corelib_global_qglobal.cpp 11A +*/ + +/*! \fn int qRound(float value) \relates <QtGlobal> Rounds \a value to the nearest integer. Example: - \snippet code/src_corelib_global_qglobal.cpp 11 + \snippet code/src_corelib_global_qglobal.cpp 11B */ -/*! \fn qint64 qRound64(qreal value) +/*! \fn qint64 qRound64(double value) \relates <QtGlobal> Rounds \a value to the nearest 64-bit integer. Example: - \snippet code/src_corelib_global_qglobal.cpp 12 + \snippet code/src_corelib_global_qglobal.cpp 12A +*/ + +/*! \fn qint64 qRound64(float value) + \relates <QtGlobal> + + Rounds \a value to the nearest 64-bit integer. + + Example: + + \snippet code/src_corelib_global_qglobal.cpp 12B */ /*! \fn const T &qMin(const T &value1, const T &value2) @@ -1262,7 +1280,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \relates <QtGlobal> Defined on all supported versions of Windows. That is, if - \l Q_OS_WIN32, \l Q_OS_WIN64, \l Q_OS_WINCE or \l Q_OS_WINRT is defined. + \l Q_OS_WIN32, \l Q_OS_WIN64 or \l Q_OS_WINRT is defined. */ /*! @@ -1280,13 +1298,6 @@ bool qSharedBuild() Q_DECL_NOTHROW */ /*! - \macro Q_OS_WINCE - \relates <QtGlobal> - - Defined on Windows CE. -*/ - -/*! \macro Q_OS_WINRT \relates <QtGlobal> @@ -1922,7 +1933,7 @@ QSysInfo::MacVersion QSysInfo::macVersion() } const QSysInfo::MacVersion QSysInfo::MacintoshVersion = QSysInfo::macVersion(); -#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINCE) || defined(Q_OS_WINRT) +#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINRT) QT_BEGIN_INCLUDE_NAMESPACE #include "qt_windows.h" @@ -1975,9 +1986,7 @@ static inline OSVERSIONINFOEX determineWinOsVersion() { OSVERSIONINFOEX result = { sizeof(OSVERSIONINFOEX), 0, 0, 0, 0, {'\0'}, 0, 0, 0, 0, 0}; -#ifndef Q_OS_WINCE #define GetProcAddressA GetProcAddress -#endif // GetModuleHandle is not supported in WinRT and linking to it at load time // will not pass the Windows App Certification Kit... but it exists and is functional, @@ -2048,11 +2057,6 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() const OSVERSIONINFOEX osver = winOsVersion(); if (osver.dwMajorVersion == 0) return QSysInfo::WV_None; -#ifdef Q_OS_WINCE - DWORD qt_cever = 0; - qt_cever = osver.dwMajorVersion * 100; - qt_cever += osver.dwMinorVersion * 10; -#endif switch (osver.dwPlatformId) { case VER_PLATFORM_WIN32s: winver = QSysInfo::WV_32s; @@ -2066,18 +2070,6 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() else winver = QSysInfo::WV_95; break; -#ifdef Q_OS_WINCE - case VER_PLATFORM_WIN32_CE: - if (qt_cever >= 600) - winver = QSysInfo::WV_CE_6; - if (qt_cever >= 500) - winver = QSysInfo::WV_CE_5; - else if (qt_cever >= 400) - winver = QSysInfo::WV_CENET; - else - winver = QSysInfo::WV_CE; - break; -#endif default: // VER_PLATFORM_WIN32_NT if (osver.dwMajorVersion < 5) { winver = QSysInfo::WV_NT; @@ -2168,15 +2160,6 @@ static const char *winVer_helper() return workstation ? "8.1" : "Server 2012 R2"; case QSysInfo::WV_WINDOWS10: return workstation ? "10" : "Server 2016"; - - case QSysInfo::WV_CE: - return "CE"; - case QSysInfo::WV_CENET: - return "CENET"; - case QSysInfo::WV_CE_5: - return "CE5"; - case QSysInfo::WV_CE_6: - return "CE6"; } // unknown, future version return 0; @@ -2434,7 +2417,7 @@ QString QSysInfo::buildCpuArchitecture() */ QString QSysInfo::currentCpuArchitecture() { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) // We don't need to catch all the CPU architectures in this function; // only those where the host CPU might be different than the build target // (usually, 64-bit platforms). @@ -2586,9 +2569,7 @@ static QString unknownText() */ QString QSysInfo::kernelType() { -#if defined(Q_OS_WINCE) - return QStringLiteral("wince"); -#elif defined(Q_OS_WIN) +#if defined(Q_OS_WIN) return QStringLiteral("winnt"); #elif defined(Q_OS_UNIX) struct utsname u; @@ -2652,8 +2633,7 @@ QString QSysInfo::kernelVersion() "unknown" otherwise. \b{Windows note}: this function returns "winphone" for builds for Windows - Phone, "winrt" for WinRT builds, "wince" for Windows CE and Embedded - Compact builds, and "windows" for normal desktop builds. + Phone, "winrt" for WinRT builds and "windows" for normal desktop builds. For other Unix-type systems, this function usually returns "unknown". @@ -2666,8 +2646,6 @@ QString QSysInfo::productType() return QStringLiteral("winphone"); #elif defined(Q_OS_WINRT) return QStringLiteral("winrt"); -#elif defined(Q_OS_WINCE) - return QStringLiteral("wince"); #elif defined(Q_OS_WIN) return QStringLiteral("windows"); diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 235bae89af..7800f8c562 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -526,23 +526,11 @@ Q_DECL_CONSTEXPR inline int qRound(double d) { return d >= 0.0 ? int(d + 0.5) : int(d - double(int(d-1)) + 0.5) + int(d-1); } Q_DECL_CONSTEXPR inline int qRound(float d) { return d >= 0.0f ? int(d + 0.5f) : int(d - float(int(d-1)) + 0.5f) + int(d-1); } -#ifdef Q_QDOC -/* - Just for documentation generation -*/ -int qRound(qreal d); -#endif Q_DECL_CONSTEXPR inline qint64 qRound64(double d) { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - double(qint64(d-1)) + 0.5) + qint64(d-1); } Q_DECL_CONSTEXPR inline qint64 qRound64(float d) { return d >= 0.0f ? qint64(d + 0.5f) : qint64(d - float(qint64(d-1)) + 0.5f) + qint64(d-1); } -#ifdef Q_QDOC -/* - Just for documentation generation -*/ -qint64 qRound64(qreal d); -#endif template <typename T> Q_DECL_CONSTEXPR inline const T &qMin(const T &a, const T &b) { return (a < b) ? a : b; } diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index de37731b1a..295de9485a 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -169,7 +169,7 @@ static bool isFatal(QtMsgType msgType) static bool willLogToConsole() { -#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT) +#if defined(Q_OS_WINRT) // these systems have no stderr, so always log to the system log return false; #elif defined(QT_BOOTSTRAPPED) @@ -1172,7 +1172,7 @@ void QMessagePattern::setPattern(const QString &pattern) else if (inIf) error += QStringLiteral("QT_MESSAGE_PATTERN: missing %{endif}\n"); if (!error.isEmpty()) { -#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT) +#if defined(Q_OS_WINRT) OutputDebugString(reinterpret_cast<const wchar_t*>(error.utf16())); if (0) #elif defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB) diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index 5705bc29c8..b7f7d5187c 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -56,7 +56,7 @@ #include <cmath> #include <limits> -#if defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) +#if defined(Q_CC_MSVC) # include <intrin.h> #elif defined(Q_CC_INTEL) # include <immintrin.h> // for _addcarry_u<nn> diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index b74fc80468..141d45e0db 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -69,7 +69,7 @@ public: LittleEndian # ifdef Q_QDOC - , ByteOrder = <platform-dependent> + , ByteOrder = BigEndian or LittleEndian # elif Q_BYTE_ORDER == Q_BIG_ENDIAN , ByteOrder = BigEndian # elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN @@ -109,13 +109,7 @@ public: WV_6_1 = WV_WINDOWS7, WV_6_2 = WV_WINDOWS8, WV_6_3 = WV_WINDOWS8_1, - WV_10_0 = WV_WINDOWS10, - - WV_CE = 0x0100, - WV_CENET = 0x0200, - WV_CE_5 = 0x0300, - WV_CE_6 = 0x0400, - WV_CE_based = 0x0f00 + WV_10_0 = WV_WINDOWS10 }; #if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) static const WinVersion WindowsVersion; diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 97f750a3a6..ee4b88cdbb 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -56,7 +56,6 @@ OS2 - OS/2 OS2EMX - XFree86 on OS/2 (not PM) WIN32 - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008) - WINCE - WinCE (Windows CE 5.0) WINRT - WinRT (Windows 8 Runtime) CYGWIN - Cygwin SOLARIS - Sun Solaris @@ -128,9 +127,7 @@ # define Q_OS_WIN32 # define Q_OS_WIN64 #elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) -# if defined(WINCE) || defined(_WIN32_WCE) -# define Q_OS_WINCE -# elif defined(WINAPI_FAMILY) +# if defined(WINAPI_FAMILY) # ifndef WINAPI_FAMILY_PC_APP # define WINAPI_FAMILY_PC_APP WINAPI_FAMILY_APP # endif @@ -205,7 +202,7 @@ # error "Qt has not been ported to this OS - see http://www.qt-project.org/" #endif -#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINCE) || defined(Q_OS_WINRT) +#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINRT) # define Q_OS_WIN #endif diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h index 8ac3c2135d..000da29fb8 100644 --- a/src/corelib/global/qt_windows.h +++ b/src/corelib/global/qt_windows.h @@ -48,10 +48,10 @@ #if defined(Q_CC_MINGW) // mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation # ifndef WINVER -# define WINVER 0x501 +# define WINVER 0x600 # endif # ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0501 +# define _WIN32_WINNT 0x600 # endif #endif |