From 44af54419eaceb27bb729717d6363917fd6bb819 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 23 Nov 2016 12:25:17 +0100 Subject: Properly use the "process" feature Replace all QT_NO_PROCESS with QT_CONFIG(process), define it in qconfig-bootstrapped.h, add QT_REQUIRE_CONFIG(process) to the qprocess headers, exclude the sources from compilation when switched off, guard header inclusions in places where compilation without QProcess seems supported, drop some unused includes, and fix some tests that were apparently designed to work with QT_NO_PROCESS but failed to. Change-Id: Ieceea2504dea6fdf43b81c7c6b65c547b01b9714 Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qcore_unix_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index 80058d9115..8f37aec6e2 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -300,7 +300,7 @@ static inline int qt_safe_close(int fd) #define QT_CLOSE qt_safe_close // - VxWorks & iOS/tvOS/watchOS don't have processes -#if !defined(Q_OS_VXWORKS) && !defined(QT_NO_PROCESS) +#if QT_CONFIG(process) static inline int qt_safe_execve(const char *filename, char *const argv[], char *const envp[]) { @@ -329,7 +329,7 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options) EINTR_LOOP(ret, ::waitpid(pid, status, options)); return ret; } -#endif // Q_OS_VXWORKS +#endif // QT_CONFIG(process) #if !defined(_POSIX_MONOTONIC_CLOCK) # define _POSIX_MONOTONIC_CLOCK -1 -- cgit v1.2.3 From 17d780ad457fb9cbfc92bf6114bfcf4cc4ac5a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Tue, 28 Feb 2017 08:54:56 +0100 Subject: QTimer: Avoid implicit conversion warnings This fixes compiling an application using QTimer and -Wshorten-64-to-32 on a 64-bit system without getting this warning: ... 5.8/clang_64/lib/QtCore.framework/Headers/qtimer.h:171:21: warning: implicit conversion loses integer precision: 'rep' (aka 'long long') to 'int' [-Wshorten-64-to-32] setInterval(value.count()); ~~~~~~~~~~~ ^~~~~~~~~~~~~ Change-Id: I3e0407a7193c841308f7271c41a8dd5a2eb2a534 Reviewed-by: Marc Mutz --- src/corelib/kernel/qtimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index 96c7efd8f5..9303f82544 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -168,7 +168,7 @@ public: Q_ALWAYS_INLINE void setInterval(std::chrono::milliseconds value) { - setInterval(value.count()); + setInterval(int(value.count())); } Q_ALWAYS_INLINE -- cgit v1.2.3 From d6330a19b29ebff359a6746250c78437dbcaf77d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 19 Dec 2016 10:34:32 +0100 Subject: Use QT_CONFIG(library) instead of QT_NO_LIBRARY For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qcoreapplication.cpp | 12 ++++++------ src/corelib/kernel/qcoreapplication.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index c5f2e71f8c..baf140b3b2 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -339,7 +339,7 @@ struct QCoreApplicationData { QString applicationVersion; bool applicationNameSet; // true if setApplicationName was called -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QScopedPointer app_libpaths; QScopedPointer manual_libpaths; #endif @@ -534,7 +534,7 @@ void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver) void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths() { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QStringList *app_libpaths = coreappdata()->app_libpaths.data(); if (!app_libpaths) coreappdata()->app_libpaths.reset(app_libpaths = new QStringList); @@ -735,7 +735,7 @@ void QCoreApplicationPrivate::init() QLoggingRegistry::instance()->init(); -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) // Reset the lib paths, so that they will be recomputed, taking the availability of argv[0] // into account. If necessary, recompute right away and replay the manual changes on top of the // new lib paths. @@ -834,7 +834,7 @@ QCoreApplication::~QCoreApplication() QCoreApplicationPrivate::eventDispatcher = 0; #endif -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) coreappdata()->app_libpaths.reset(); coreappdata()->manual_libpaths.reset(); #endif @@ -2414,7 +2414,7 @@ QString QCoreApplication::applicationVersion() return coreappdata()->applicationVersion; } -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive)) @@ -2626,7 +2626,7 @@ void QCoreApplication::removeLibraryPath(const QString &path) QFactoryLoader::refreshAll(); } -#endif //QT_NO_LIBRARY +#endif // QT_CONFIG(library) #ifndef QT_NO_QOBJECT diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index a22e1c4f9e..5e10136dc5 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -141,12 +141,12 @@ public: static QString applicationFilePath(); static qint64 applicationPid(); -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) static void setLibraryPaths(const QStringList &); static QStringList libraryPaths(); static void addLibraryPath(const QString &); static void removeLibraryPath(const QString &); -#endif // QT_NO_LIBRARY +#endif // QT_CONFIG(library) #ifndef QT_NO_TRANSLATION static bool installTranslator(QTranslator * messageFile); -- cgit v1.2.3