summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcore_unix.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-18 13:22:25 +0100
committerLars Knoll <lars.knoll@qt.io>2016-11-30 08:11:12 +0000
commitb82650891ee594628fb1bd150408a23a37217e72 (patch)
tree3aa67bab2d90f7661c4fa0bdc812f90f6faa0c3e /src/corelib/kernel/qcore_unix.cpp
parent8f2088db171a6941feb1903a2912a8b7fdf3a9ec (diff)
Use poll related features properly
And get rid of related DEFINES in the pri file Change-Id: I54cf25b7cb447af22b410213759044e8018939a6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/corelib/kernel/qcore_unix.cpp')
-rw-r--r--src/corelib/kernel/qcore_unix.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 2042964427..686143f8c7 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -38,6 +38,7 @@
**
****************************************************************************/
+#include <QtCore/private/qglobal_p.h>
#include "qcore_unix_p.h"
#include "qelapsedtimer.h"
@@ -49,9 +50,8 @@
QT_BEGIN_NAMESPACE
-#if !defined(QT_HAVE_PPOLL) && defined(QT_HAVE_POLLTS)
-# define ppoll pollts
-# define QT_HAVE_PPOLL
+#if QT_CONFIG(poll_pollts)
+# define ppoll pollts
#endif
static inline bool time_update(struct timespec *tv, const struct timespec &start,
@@ -64,7 +64,7 @@ static inline bool time_update(struct timespec *tv, const struct timespec &start
return tv->tv_sec >= 0;
}
-#if !defined(QT_HAVE_PPOLL) && defined(QT_HAVE_POLL)
+#if QT_CONFIG(poll_poll)
static inline int timespecToMillisecs(const struct timespec *ts)
{
return (ts == NULL) ? -1 :
@@ -77,9 +77,9 @@ int qt_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts);
static inline int qt_ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)
{
-#if defined(QT_HAVE_PPOLL)
- return ::ppoll(fds, nfds, timeout_ts, Q_NULLPTR);
-#elif defined(QT_HAVE_POLL)
+#if QT_CONFIG(poll_ppoll) || QT_CONFIG(poll_pollts)
+ return ::ppoll(fds, nfds, timeout_ts, nullptr);
+#elif QT_CONFIG(poll_poll)
return ::poll(fds, nfds, timespecToMillisecs(timeout_ts));
#else
return qt_poll(fds, nfds, timeout_ts);