QEventDispatcherUNIX: convert "eventfd" feature to proper QT_CONFIG

And mark it private.

[ChangeLog][QtCore] Qt no longer sets the QT_NO_EVENTFD feature macro
on systems without eventfd.

Change-Id: I63b988479db546dabffcfffd1766e1df5255c930
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Thiago Macieira 2023-06-08 21:04:19 -07:00
parent bc2ae5a708
commit a1451bbb57
2 changed files with 5 additions and 6 deletions

View File

@ -590,11 +590,10 @@ qt_feature("dladdr" PRIVATE
LABEL "dladdr"
CONDITION QT_FEATURE_dlopen AND TEST_dladdr
)
qt_feature("eventfd" PUBLIC
qt_feature("eventfd" PRIVATE
LABEL "eventfd"
CONDITION NOT WASM AND TEST_eventfd
)
qt_feature_definition("eventfd" "QT_NO_EVENTFD" NEGATE VALUE "1")
qt_feature("futimens" PRIVATE
LABEL "futimens()"
CONDITION NOT WIN32 AND TEST_futimens

View File

@ -19,7 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifndef QT_NO_EVENTFD
#if QT_CONFIG(eventfd)
# include <sys/eventfd.h>
#endif
@ -116,7 +116,7 @@ bool QThreadPipe::init()
initThreadPipeFD(fds[0]);
fds[1] = fds[0];
#else
# ifndef QT_NO_EVENTFD
# if QT_CONFIG(eventfd)
if ((fds[0] = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC)) >= 0)
return true;
# endif
@ -137,7 +137,7 @@ pollfd QThreadPipe::prepare() const
void QThreadPipe::wakeUp()
{
if (wakeUps.testAndSetAcquire(0, 1)) {
#ifndef QT_NO_EVENTFD
#if QT_CONFIG(eventfd)
if (fds[1] == -1) {
// eventfd
eventfd_t value = 1;
@ -165,7 +165,7 @@ int QThreadPipe::check(const pollfd &pfd)
::read(fds[0], c, sizeof(c));
::ioctl(fds[0], FIOFLUSH, 0);
#else
# ifndef QT_NO_EVENTFD
# if QT_CONFIG(eventfd)
if (fds[1] == -1) {
// eventfd
eventfd_t value;