tst_reconnect: Include <unistd.h>

This fixes this build error seen in a local -no-pch
clang 19 build:

    [17/19] Building CXX object qtwayland/tests/auto/client/reconnect/CMakeFiles/tst_wl_reconnect.dir/tst_reconnect.cpp.o
    FAILED: qtwayland/tests/auto/client/reconnect/CMakeFiles/tst_wl_reconnect.dir/tst_reconnect.cpp.o
    /usr/bin/ccache /usr/bin/clang++ -DQT_CORE_LIB -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_GUI_LIB -DQT_NO_AS_CONST=1 -DQT_NO_CONTEXTLESS_CONNECT=1 -DQT_NO_FOREACH -DQT_NO_FOREACH=1 -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QSNPRINTF -DQT_OPENGL_LIB -DQT_STRICT_QLIST_ITERATORS -DQT_TESTCASE_BUILDDIR=\"/home/michi/development/git/qt5/qtwayland/tests/auto/client/reconnect\" -DQT_TESTCASE_SOURCEDIR=\"/home/michi/development/git/qt5/qtwayland/tests/auto/client/reconnect\" -DQT_TESTLIB_LIB -DQT_WAYLANDCLIENT_LIB -DQT_WAYLANDGLOBAL_LIB -D_GLIBCXX_ASSERTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/michi/development/git/qt5/qtwayland/tests/auto/client/reconnect/tst_wl_reconnect_autogen/include -I/home/michi/development/git/qt5/qtwayland/tests/auto/client/reconnect -I/home/michi/development/git/qt5/qtbase/include -I/home/michi/development/git/qt5/qtwayland/tests/auto/client/shared -I/home/michi/development/git/qt5/qtbase/include/QtGui -I/home/michi/development/git/qt5/qtbase/include/QtCore -I/home/michi/development/git/qt5/qtbase/mkspecs/linux-clang -I/home/michi/development/git/qt5/qtbase/include/QtOpenGL -I/home/michi/development/git/qt5/qtwayland/src/client -I/home/michi/development/git/qt5/qtbase/include/QtWaylandClient/6.10.0 -I/home/michi/development/git/qt5/qtbase/include/QtWaylandClient/6.10.0/QtWaylandClient -I/home/michi/development/git/qt5/qtbase/src/corelib -I/home/michi/development/git/qt5/qtbase/include/QtCore/6.10.0 -I/home/michi/development/git/qt5/qtbase/include/QtCore/6.10.0/QtCore -I/home/michi/development/git/qt5/qtbase/src/gui -I/home/michi/development/git/qt5/qtbase/include/QtGui/6.10.0 -I/home/michi/development/git/qt5/qtbase/include/QtGui/6.10.0/QtGui -I/home/michi/development/git/qt5/qtbase/include/QtWaylandGlobal -I/home/michi/development/git/qt5/qtwayland/src -I/home/michi/development/git/qt5/qtbase/include/QtWaylandGlobal/6.10.0 -I/home/michi/development/git/qt5/qtbase/include/QtWaylandGlobal/6.10.0/QtWaylandGlobal -I/home/michi/development/git/qt5/qtbase/include/QtWaylandClient -I/home/michi/development/git/qt5/qtbase/include/QtTest -D_GLIBCXX_DEBUG -g -std=gnu++17 -fPIE -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fPIC -fcf-protection=full -ftrivial-auto-var-init=pattern -fstack-protector-strong -fexceptions -MD -MT qtwayland/tests/auto/client/reconnect/CMakeFiles/tst_wl_reconnect.dir/tst_reconnect.cpp.o -MF qtwayland/tests/auto/client/reconnect/CMakeFiles/tst_wl_reconnect.dir/tst_reconnect.cpp.o.d -o qtwayland/tests/auto/client/reconnect/CMakeFiles/tst_wl_reconnect.dir/tst_reconnect.cpp.o -c /home/michi/development/git/qt5/qtwayland/tests/auto/client/reconnect/tst_reconnect.cpp
    /home/michi/development/git/qt5/qtwayland/tests/auto/client/reconnect/tst_reconnect.cpp:123:65: error: use of undeclared identifier 'dup'
      123 |     m_comp.reset(new DefaultCompositor(CoreCompositor::Default, dup(socketFd)));
          |                                                                 ^
    /home/michi/development/git/qt5/qtwayland/tests/auto/client/reconnect/tst_reconnect.cpp:130:65: error: use of undeclared identifier 'dup'
      130 |     m_comp.reset(new DefaultCompositor(CoreCompositor::Default, dup(socketFd)));
          |                                                                 ^
    2 errors generated.
    ninja: build stopped: subcommand failed.

Change-Id: I2bf139ec582f90e2b447223c3092836c79483156
Reviewed-by: David Redondo <qt@david-redondo.de>
This commit is contained in:
Michael Weghorn 2025-04-13 21:10:34 +02:00
parent 71dedf56d7
commit 745bbca004

View File

@ -22,6 +22,8 @@
#include "wl-socket.h"
#include <unistd.h>
using namespace MockCompositor;
class TestWindow : public QRasterWindow