From 50d70fd1e374d04d8c1d0d9d78b572c4650e7320 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 8 Jun 2016 18:51:53 -0700 Subject: Fix warning when compiling x86 with SSE2 but no AVX2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qstring.cpp:595:13: error: unused variable ‘nullmask’ [-Werror=unused-variable] Change-Id: I1cc7601489634e96833cfffd1456474a529a79ed Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Erik Verbruggen --- src/corelib/tools/qstring.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index be1ca8ba95..8eadc9330d 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -594,6 +594,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l) } # else // 32-bit, we can't do MOVQ to load 8 bytes + Q_UNUSED(nullmask); enum { MaxTailLength = 15 }; # endif -- cgit v1.2.3 From d4e98a9a3856d60d52d54870af8dcefa907acf92 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Thu, 11 Feb 2016 10:10:21 -0500 Subject: Move __cpp_constexpr check inside Q_COMPILER_CONSTEXPR check Q_COMPILER_CONSTEXPR can be undefined (or not defined at all) to indicate that constexpr should not be used regardless of the compiler's ability to support it. This is done for QNX because some C library floating point functions used in the Dinkumware C++ library aren't constexpr functions; i.e., the library doesn't have proper constexpr support even though the compiler does. (cherry picked from commit d87242968fc56ba09243f642ce70a85084619de0) Change-Id: If0bdeb2180710dd9ccd97d79fa91cf9ff42f7990 Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 01b3a298af..2d9e0463b7 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1010,16 +1010,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 -- cgit v1.2.3 From 038c57f4b3aca1b35244fb9fbb0ae81c53279c6f Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Wed, 8 Jun 2016 14:42:09 +0200 Subject: winrt: Close IAsyncInfo manually in case of error In case QEventDispatcherWinRT::runOnXamlThread returns an error the runtime sets the status of IAsyncInfo to Error. At the point when the IAsyncInfo destructor is invoked, an unhandled exception is thrown indicating the error has not been handled, causing any application to just crash deep inside the Windows platform libraries. Hence, in case runOnXamlThread returns non-S_OK we have to manually invoke Close() of the IAsyncInfo to tell the system we have taken care of everything. Change-Id: I3ac1e2ec2726f42e44f4f9a92191e454711120dd Reviewed-by: Oliver Wolff --- src/corelib/kernel/qfunctions_winrt.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h index dc1cbe0ade..9af5a08a01 100644 --- a/src/corelib/kernel/qfunctions_winrt.h +++ b/src/corelib/kernel/qfunctions_winrt.h @@ -203,6 +203,9 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr &asyncOp, Awai if (FAILED(hr) || status != Completed) { HRESULT ec; hr = asyncInfo->get_ErrorCode(&ec); + if (FAILED(hr)) + return hr; + hr = asyncInfo->Close(); if (FAILED(hr)) return hr; return ec; -- cgit v1.2.3 From 27e94bd9d1ac5faaa8b1e4ee5d57f820675194b1 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 17 May 2016 16:35:04 +0200 Subject: winrt: Fix potential crash in QCoreApplication GetModuleFileName exists for Windows 10 and upwards, hence use the generic version from the win32 mkspec. This allows to create a QCoreApplication object with nullptr argv, as the application filename is identified via the binary itself and not via arguments. A couple of auto-tests use this method to create multiple application objects during runtime. Unfortunately we cannot apply this for msvc2013, even though MSDN states the GetModuleFileName exists, it fails to compile for Windows Phone 8.1. Change-Id: I2b8b988107487ef3785462f8ca40b0a6e0623e32 Reviewed-by: Thiago Macieira Reviewed-by: Oliver Wolff --- src/corelib/kernel/qcoreapplication_win.cpp | 59 ++++++++++++++++------------- 1 file changed, 33 insertions(+), 26 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 324b664a1a..1af1d44f2e 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -49,7 +49,10 @@ QT_BEGIN_NAMESPACE int appCmdShow = 0; -#if defined(Q_OS_WINRT) +// GetModuleFileName only exists for MSVC2015 and upwards for WinRT, meaning +// Windows 10 (Mobile). Hence take the first argument passed to the +// QCoreApplication contructor for older versions as a fallback on older platforms. +#if defined(Q_OS_WINRT) && _MSC_VER < 1900 Q_CORE_EXPORT QString qAppFileName() { @@ -61,31 +64,7 @@ QString QCoreApplicationPrivate::appName() const return QFileInfo(QCoreApplication::arguments().first()).baseName(); } -#else - -Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle -{ - return GetModuleHandle(0); -} - -Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle -{ - return 0; -} - -Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command -{ -#if defined(Q_OS_WINCE) - return appCmdShow; -#else - STARTUPINFO startupInfo; - GetStartupInfo(&startupInfo); - - return (startupInfo.dwFlags & STARTF_USESHOWWINDOW) - ? startupInfo.wShowWindow - : SW_SHOWDEFAULT; -#endif -} +#else // !(defined(Q_OS_WINRT) && _MSC_VER < 1900) Q_CORE_EXPORT QString qAppFileName() // get application file name { @@ -133,6 +112,34 @@ QString QCoreApplicationPrivate::appName() const return QFileInfo(qAppFileName()).baseName(); } +#endif // !(defined(Q_OS_WINRT) && _MSC_VER < 1900) + +#ifndef Q_OS_WINRT + +Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle +{ + return GetModuleHandle(0); +} + +Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle +{ + return 0; +} + +Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command +{ +#if defined(Q_OS_WINCE) + return appCmdShow; +#else + STARTUPINFO startupInfo; + GetStartupInfo(&startupInfo); + + return (startupInfo.dwFlags & STARTF_USESHOWWINDOW) + ? startupInfo.wShowWindow + : SW_SHOWDEFAULT; +#endif +} + /***************************************************************************** qWinMain() - Initializes Windows. Called from WinMain() in qtmain_win.cpp *****************************************************************************/ -- cgit v1.2.3 From e969e6d2ca5636b87b3de963ebd8dac993275617 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Thu, 9 Jun 2016 12:13:08 -0400 Subject: Fix cast warnings when pthread_t is smaller than a pointer Push conversions from pthread_t to Qt::HANDLE and back into functions. The casts that were being used didn't work for the unusual 64-bit pointer/32-bit int combination that QNX is using for 7.0. HANDLE ends up as a 64-bit pointer and pthread_t ends up as a 32-bit integer. g++ considers the precision loss when converting from the 64-bit pointer to the 32-bit integer an error. Better to have the casts hidden in functions so it's easier to adjust them for unusual combinations such as this. Change-Id: Ia156b26224a0f7edc1c31e3d1ee8b21191381698 Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread_unix.cpp | 55 ++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 16 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 3fc0ebfbb6..8c35d49aa3 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -105,7 +105,7 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_THREAD -Q_STATIC_ASSERT(sizeof(pthread_t) == sizeof(Qt::HANDLE)); +Q_STATIC_ASSERT(sizeof(pthread_t) <= sizeof(Qt::HANDLE)); enum { ThreadPriorityResetFlag = 0x80000000 }; @@ -205,6 +205,30 @@ static void clear_thread_data() pthread_setspecific(current_thread_data_key, 0); } +template +static typename QtPrivate::QEnableIf::isIntegral, Qt::HANDLE>::Type to_HANDLE(T id) +{ + return reinterpret_cast(static_cast(id)); +} + +template +static typename QtPrivate::QEnableIf::isIntegral, T>::Type from_HANDLE(Qt::HANDLE id) +{ + return static_cast(reinterpret_cast(id)); +} + +template +static typename QtPrivate::QEnableIf::isPointer, Qt::HANDLE>::Type to_HANDLE(T id) +{ + return id; +} + +template +static typename QtPrivate::QEnableIf::isPointer, T>::Type from_HANDLE(Qt::HANDLE id) +{ + return static_cast(id); +} + void QThreadData::clearCurrentThreadData() { clear_thread_data(); @@ -226,7 +250,7 @@ QThreadData *QThreadData::current(bool createIfNecessary) } data->deref(); data->isAdopted = true; - data->threadId = (Qt::HANDLE)pthread_self(); + data->threadId = to_HANDLE(pthread_self()); if (!QCoreApplicationPrivate::theMainThread) QCoreApplicationPrivate::theMainThread = data->thread.load(); } @@ -308,7 +332,7 @@ void *QThreadPrivate::start(void *arg) thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag)); } - data->threadId = (Qt::HANDLE)pthread_self(); + data->threadId = to_HANDLE(pthread_self()); set_thread_data(data); data->ref(); @@ -325,7 +349,7 @@ void *QThreadPrivate::start(void *arg) // sets the name of the current thread. QString objectName = thr->objectName(); - pthread_t thread_id = reinterpret_cast(data->threadId); + pthread_t thread_id = from_HANDLE(data->threadId); if (Q_LIKELY(objectName.isEmpty())) setCurrentThreadName(thread_id, thr->metaObject()->className()); else @@ -388,7 +412,7 @@ void QThreadPrivate::finish(void *arg) Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW { // requires a C cast here otherwise we run into trouble on AIX - return (Qt::HANDLE)pthread_self(); + return to_HANDLE(pthread_self()); } #if defined(QT_LINUXBASE) && !defined(_SC_NPROCESSORS_ONLN) @@ -614,18 +638,17 @@ void QThread::start(Priority priority) } } - int code = - pthread_create(reinterpret_cast(&d->data->threadId), &attr, - QThreadPrivate::start, this); + pthread_t threadId; + int code = pthread_create(&threadId, &attr, QThreadPrivate::start, this); if (code == EPERM) { // caller does not have permission to set the scheduling // parameters/policy #if defined(QT_HAS_THREAD_PRIORITY_SCHEDULING) pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED); #endif - code = pthread_create(reinterpret_cast(&d->data->threadId), &attr, - QThreadPrivate::start, this); + code = pthread_create(&threadId, &attr, QThreadPrivate::start, this); } + d->data->threadId = to_HANDLE(threadId); pthread_attr_destroy(&attr); @@ -647,7 +670,7 @@ void QThread::terminate() if (!d->data->threadId) return; - int code = pthread_cancel(reinterpret_cast(d->data->threadId)); + int code = pthread_cancel(from_HANDLE(d->data->threadId)); if (code) { qWarning("QThread::start: Thread termination error: %s", qPrintable(qt_error_string((code)))); @@ -660,7 +683,7 @@ bool QThread::wait(unsigned long time) Q_D(QThread); QMutexLocker locker(&d->mutex); - if (reinterpret_cast(d->data->threadId) == pthread_self()) { + if (from_HANDLE(d->data->threadId) == pthread_self()) { qWarning("QThread::wait: Thread tried to wait on itself"); return false; } @@ -702,7 +725,7 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority) int sched_policy; sched_param param; - if (pthread_getschedparam(reinterpret_cast(data->threadId), &sched_policy, ¶m) != 0) { + if (pthread_getschedparam(from_HANDLE(data->threadId), &sched_policy, ¶m) != 0) { // failed to get the scheduling policy, don't bother setting // the priority qWarning("QThread::setPriority: Cannot get scheduler parameters"); @@ -718,15 +741,15 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority) } param.sched_priority = prio; - int status = pthread_setschedparam(reinterpret_cast(data->threadId), sched_policy, ¶m); + int status = pthread_setschedparam(from_HANDLE(data->threadId), sched_policy, ¶m); # ifdef SCHED_IDLE // were we trying to set to idle priority and failed? if (status == -1 && sched_policy == SCHED_IDLE && errno == EINVAL) { // reset to lowest priority possible - pthread_getschedparam(reinterpret_cast(data->threadId), &sched_policy, ¶m); + pthread_getschedparam(from_HANDLE(data->threadId), &sched_policy, ¶m); param.sched_priority = sched_get_priority_min(sched_policy); - pthread_setschedparam(reinterpret_cast(data->threadId), sched_policy, ¶m); + pthread_setschedparam(from_HANDLE(data->threadId), sched_policy, ¶m); } # else Q_UNUSED(status); -- cgit v1.2.3 From 3e2bde35786f503c9031c34454b741a02426bb9a Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 10 Jun 2016 21:13:35 -0700 Subject: Update for the newest Darwin-family operating systems. - Adapt to the OS X => macOS rename in Q_OS_ macros/docs, qmake scopes, file selectors, etc. - Add new QSysInfo values and MAC_OS_X / __MAC_ / __IPHONE_ values for macOS 10.12 and iOS 9.1 through 10.0. - Update prettyProductName with new macOS "Sierra" codename. Change-Id: Id976530beeafa01b648ebaa16f4a8f0613fcaf75 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 41 +++++++++++++++++++++++++---------- src/corelib/global/qsysinfo.h | 8 ++++++- src/corelib/global/qsystemdetection.h | 26 ++++++++++++++++++---- src/corelib/io/qfileselector.cpp | 6 ++++- 4 files changed, 64 insertions(+), 17 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 77724d2a0d..8b6d8745f8 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1134,6 +1134,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_10_9 OS X 10.9 \value MV_10_10 OS X 10.10 \value MV_10_11 OS X 10.11 + \value MV_10_12 macOS 10.12 \value MV_Unknown An unknown and currently unsupported platform \value MV_CHEETAH Apple codename for MV_10_0 @@ -1148,6 +1149,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_MAVERICKS Apple codename for MV_10_9 \value MV_YOSEMITE Apple codename for MV_10_10 \value MV_ELCAPITAN Apple codename for MV_10_11 + \value MV_SIERRA Apple codename for MV_10_12 \value MV_IOS iOS (any) \value MV_IOS_4_3 iOS 4.3 @@ -1163,6 +1165,10 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_IOS_8_3 iOS 8.3 \value MV_IOS_8_4 iOS 8.4 \value MV_IOS_9_0 iOS 9.0 + \value MV_IOS_9_1 iOS 9.1 + \value MV_IOS_9_2 iOS 9.2 + \value MV_IOS_9_3 iOS 9.3 + \value MV_IOS_10_0 iOS 10.0 \value MV_None Not a Darwin operating system @@ -1173,23 +1179,28 @@ bool qSharedBuild() Q_DECL_NOTHROW \macro Q_OS_DARWIN \relates - Defined on Darwin-based operating systems such as OS X and iOS, - including any open source version(s) of Darwin. + Defined on Darwin-based operating systems such as OS X and iOS. */ /*! \macro Q_OS_MAC \relates - Defined on Darwin-based operating systems distributed by Apple, which - currently includes OS X and iOS, but not the open source versions of Darwin. + Deprecated synonym for \c Q_OS_DARWIN. Do not use. */ /*! \macro Q_OS_OSX \relates - Defined on OS X. + Deprecated synonym for \c Q_OS_MACOS. Do not use. + */ + +/*! + \macro Q_OS_MACOS + \relates + + Defined on macOS. */ /*! @@ -2573,10 +2584,12 @@ QString QSysInfo::kernelVersion() running the BlackBerry userspace, but "qnx" for all other QNX-based systems. - \b{Darwin, OS X and iOS note}: this function returns "osx" for OS X + \b{Darwin, OS X and iOS note}: this function returns "macos" for macOS systems, "ios" for iOS systems and "darwin" in case the system could not be determined. + \b{OS X note}: this function returns "osx" for versions of macOS prior to 10.12. + \b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and "unknown" otherwise. @@ -2610,8 +2623,11 @@ QString QSysInfo::productType() #elif defined(Q_OS_IOS) return QStringLiteral("ios"); -#elif defined(Q_OS_OSX) - return QStringLiteral("osx"); +#elif defined(Q_OS_MACOS) + const QAppleOperatingSystemVersion version = qt_apple_os_version(); + if (version.major == 10 && version.minor < 12) + return QStringLiteral("osx"); + return QStringLiteral("macos"); #elif defined(Q_OS_DARWIN) return QStringLiteral("darwin"); @@ -2700,7 +2716,7 @@ QString QSysInfo::prettyProductName() { #if defined(Q_OS_IOS) return QLatin1String("iOS ") + productVersion(); -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) // get the known codenames const char *basename = 0; switch (int(MacintoshVersion)) { @@ -2734,12 +2750,15 @@ QString QSysInfo::prettyProductName() case MV_ELCAPITAN: basename = "OS X El Capitan ("; break; + case MV_SIERRA: + basename = "macOS Sierra ("; + break; } if (basename) return QLatin1String(basename) + productVersion() + QLatin1Char(')'); - // a future version of OS X - return QLatin1String("OS X ") + productVersion(); + // a future version of macOS + return QLatin1String("macOS ") + productVersion(); #elif defined(Q_OS_WINPHONE) return QLatin1String("Windows Phone ") + QLatin1String(winVer_helper()); #elif defined(Q_OS_WIN) diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index 27a285fd36..4b25db310f 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -138,6 +138,7 @@ public: MV_10_9 = Q_MV_OSX(10, 9), MV_10_10 = Q_MV_OSX(10, 10), MV_10_11 = Q_MV_OSX(10, 11), + MV_10_12 = Q_MV_OSX(10, 12), /* codenames */ MV_CHEETAH = MV_10_0, @@ -152,6 +153,7 @@ public: MV_MAVERICKS = MV_10_9, MV_YOSEMITE = MV_10_10, MV_ELCAPITAN = MV_10_11, + MV_SIERRA = MV_10_12, /* iOS */ MV_IOS = 1 << 8, @@ -167,7 +169,11 @@ public: MV_IOS_8_2 = Q_MV_IOS(8, 2), MV_IOS_8_3 = Q_MV_IOS(8, 3), MV_IOS_8_4 = Q_MV_IOS(8, 4), - MV_IOS_9_0 = Q_MV_IOS(9, 0) + MV_IOS_9_0 = Q_MV_IOS(9, 0), + MV_IOS_9_1 = Q_MV_IOS(9, 1), + MV_IOS_9_2 = Q_MV_IOS(9, 2), + MV_IOS_9_3 = Q_MV_IOS(9, 3), + MV_IOS_10_0 = Q_MV_IOS(10, 0) }; #if defined(Q_OS_MAC) static const MacVersion MacintoshVersion; diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index b6a7835ef2..de95ae391e 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -42,8 +42,7 @@ The operating system, must be one of: (Q_OS_x) DARWIN - Any Darwin system - MAC - OS X and iOS - OSX - OS X + MACOS - macOS IOS - iOS MSDOS - MS-DOS and Windows OS2 - OS/2 @@ -199,7 +198,8 @@ # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE # define Q_OS_IOS # elif defined(TARGET_OS_MAC) && TARGET_OS_MAC -# define Q_OS_OSX +# define Q_OS_MACOS +# define Q_OS_OSX // compatibility synonym # define Q_OS_MACX // compatibility synonym # endif #endif @@ -214,7 +214,7 @@ # include # include # -# ifdef Q_OS_OSX +# 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 @@ -243,6 +243,9 @@ # 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_OS_X_VERSION_10_7) # define MAC_OS_X_VERSION_10_7 1070 # endif @@ -258,6 +261,9 @@ # if !defined(MAC_OS_X_VERSION_10_11) # define MAC_OS_X_VERSION_10_11 101100 # endif +# if !defined(MAC_OS_X_VERSION_10_12) +# define MAC_OS_X_VERSION_10_12 101200 +# endif # # if !defined(__IPHONE_4_3) # define __IPHONE_4_3 40300 @@ -298,6 +304,18 @@ # if !defined(__IPHONE_9_0) # define __IPHONE_9_0 90000 # endif +# if !defined(__IPHONE_9_1) +# define __IPHONE_9_1 90100 +# endif +# if !defined(__IPHONE_9_2) +# define __IPHONE_9_2 90200 +# endif +# if !defined(__IPHONE_9_3) +# define __IPHONE_9_3 90300 +# endif +# if !defined(__IPHONE_10_0) +# define __IPHONE_10_0 100000 +# endif #endif #ifdef __LSB_VERSION__ diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index 52ac414645..645d0fdc46 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -383,8 +383,12 @@ QStringList QFileSelectorPrivate::platformSelectors() # endif # endif QString productName = QSysInfo::productType(); +# ifdef Q_OS_MACOS + if (productName != QStringLiteral("osx")) + ret << QStringLiteral("osx"); // compatibility +# endif if (productName != QLatin1String("unknown")) - ret << productName; // "opensuse", "fedora", "osx", "ios", "blackberry", "android" + ret << productName; // "opensuse", "fedora", "macos", "ios", "blackberry", "android" #endif return ret; } -- cgit v1.2.3 From e85e7f4b81b285efa5875a3ebf239d2f7f4523d7 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 13 Jun 2016 13:36:38 +0200 Subject: Fixed developer build for MinGW 0 must not be used as a null pointer constant Change-Id: I082d0e99c105fb02980b9cf390e7f6e4c9ad0869 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qabstracteventdispatcher.h | 3 ++- src/corelib/kernel/qmetaobject.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h index eb357cefe5..27a4c1bdcb 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.h +++ b/src/corelib/kernel/qabstracteventdispatcher.h @@ -105,7 +105,8 @@ public: void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj); bool filterNativeEvent(const QByteArray &eventType, void *message, long *result); #if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED bool filterEvent(void *message) { return filterNativeEvent("", message, 0); } + QT_DEPRECATED bool filterEvent(void *message) + { return filterNativeEvent("", message, Q_NULLPTR); } #endif Q_SIGNALS: diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h index 1a282d3261..d467ea9d68 100644 --- a/src/corelib/kernel/qmetaobject.h +++ b/src/corelib/kernel/qmetaobject.h @@ -181,7 +181,7 @@ private: // signature() has been renamed to methodSignature() in Qt 5. // Warning, that function returns a QByteArray; check the life time if // you convert to char*. - char *signature(struct renamedInQt5_warning_checkTheLifeTime * = 0) Q_DECL_EQ_DELETE; + char *signature(struct renamedInQt5_warning_checkTheLifeTime * = Q_NULLPTR) Q_DECL_EQ_DELETE; #endif static QMetaMethod fromSignalImpl(const QMetaObject *, void **); -- cgit v1.2.3 From b07736c0bc5507e663463ff8f3e3bbb905e1acc9 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Thu, 9 Jun 2016 12:15:09 -0400 Subject: Correct a type mismatch in the QNX PPS code It's a problem when building for 64-bit where the two types no longer match. Change-Id: I8c31915caf81a60d635c79816a3a2d5d36742ff9 Reviewed-by: Dan Cape Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/corelib/kernel/qppsobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qppsobject.cpp b/src/corelib/kernel/qppsobject.cpp index 76508f12c5..230b7dcae0 100644 --- a/src/corelib/kernel/qppsobject.cpp +++ b/src/corelib/kernel/qppsobject.cpp @@ -169,7 +169,7 @@ QPpsAttribute QPpsObjectPrivate::decodeNumber(pps_decoder_t *decoder) // In order to support more number types, we have to do something stupid because the PPS // library won't let us work any other way. Basically, we have to probe the encoded type in // order to try to get exactly what we want. - long long llValue; + int64_t llValue; double dValue; int iValue; QPpsAttribute::Flags flags; @@ -187,7 +187,7 @@ QPpsAttribute QPpsObjectPrivate::decodeNumber(pps_decoder_t *decoder) return QPpsAttribute(); } flags = readFlags(decoder); - return QPpsAttributePrivate::createPpsAttribute(llValue, flags); + return QPpsAttributePrivate::createPpsAttribute(static_cast(llValue), flags); default: qWarning() << "QPpsObjectPrivate::decodeNumber: pps_decoder_get_int failed"; return QPpsAttribute(); -- cgit v1.2.3 From ee2eed350f95285b65e3dd9647e5f366e16fd5a4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 17 Jun 2016 11:53:05 +0200 Subject: Remove overload tag from QByteArray QIODevice::readAll() This does not seem to be a function that is overloaded. Change-Id: Icf8942dfb1e78a2ddb38cbd1c49657f745a61989 Reviewed-by: Alex Trotsenko Reviewed-by: Thiago Macieira --- src/corelib/io/qiodevice.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 3c7a7d69e4..eba38d06d6 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -971,8 +971,6 @@ QByteArray QIODevice::read(qint64 maxSize) } /*! - \overload - Reads all remaining data from the device, and returns it as a byte array. -- cgit v1.2.3