client: Include <signal.h>

This fixes build errors like the following seen in a
local -no-pch clang 19 build:

    2/16] Building CXX object qtwayland/src/client/CMakeFiles/WaylandClient.dir/qwaylandprimaryselectionv1.cpp.o
    FAILED: qtwayland/src/client/CMakeFiles/WaylandClient.dir/qwaylandprimaryselectionv1.cpp.o
    /usr/bin/ccache /usr/bin/clang++ -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_WAYLANDCLIENT_LIB -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_GUI_LIB -DQT_MOC_COMPAT -DQT_NO_AS_CONST=1 -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT=1 -DQT_NO_EXCEPTIONS -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_NO_STD_FORMAT_SUPPORT -DQT_STRICT_QLIST_ITERATORS -DQT_USE_QSTRINGBUILDER -DQT_WAYLANDGLOBAL_LIB -DWaylandClient_EXPORTS -D_GLIBCXX_ASSERTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/michi/development/git/qt5/qtwayland/src/client/WaylandClient_autogen/include -I/home/michi/development/git/qt5/qtbase/include -I/home/michi/development/git/qt5/qtbase/include/QtWaylandClient -I/home/michi/development/git/qt5/qtwayland/src/client -I/home/michi/development/git/qt5/qtwayland/src/client/../shared -I/home/michi/development/git/qt5/qtwayland/src/client/global -I/home/michi/development/git/qt5/qtwayland/src/client/hardwareintegration -I/home/michi/development/git/qt5/qtwayland/src/client/inputdeviceintegration -I/home/michi/development/git/qt5/qtwayland/src/client/shellintegration -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/include/QtCore -I/home/michi/development/git/qt5/qtbase/mkspecs/linux-clang -I/home/michi/development/git/qt5/qtbase/include/QtGui -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 -D_GLIBCXX_DEBUG -g -std=gnu++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fPIC -Werror "-Wno-error=#warnings" -Wno-error=deprecated-declarations -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-copy-with-user-provided-copy -Wno-error=unused-but-set-variable -fcf-protection=full -ftrivial-auto-var-init=pattern -fstack-protector-strong -fno-exceptions -MD -MT qtwayland/src/client/CMakeFiles/WaylandClient.dir/qwaylandprimaryselectionv1.cpp.o -MF qtwayland/src/client/CMakeFiles/WaylandClient.dir/qwaylandprimaryselectionv1.cpp.o.d -o qtwayland/src/client/CMakeFiles/WaylandClient.dir/qwaylandprimaryselectionv1.cpp.o -c /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:121:26: error: variable has incomplete type 'struct sigaction'
      121 |         struct sigaction action, oldAction;
          |                          ^
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:121:16: note: forward declaration of 'sigaction'
      121 |         struct sigaction action, oldAction;
          |                ^
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:121:34: error: variable has incomplete type 'struct sigaction'
      121 |         struct sigaction action, oldAction;
          |                                  ^
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:121:16: note: forward declaration of 'sigaction'
      121 |         struct sigaction action, oldAction;
          |                ^
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:122:29: error: use of undeclared identifier 'SIG_IGN'
      122 |         action.sa_handler = SIG_IGN;
          |                             ^
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:126:19: error: use of undeclared identifier 'SIGPIPE'
      126 |         sigaction(SIGPIPE, &action, &oldAction);
          |                   ^
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:127:26: error: use of undeclared identifier 'write'; did you mean '_IO_cookie_io_functions_t::write'?
      127 |         ssize_t unused = write(fd, content.constData(), size_t(content.size()));
          |                          ^~~~~
          |                          _IO_cookie_io_functions_t::write
    /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:28: note: '_IO_cookie_io_functions_t::write' declared here
       58 |   cookie_write_function_t *write;       /* Write bytes.  */
          |                            ^
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:127:26: error: invalid use of non-static data member 'write'
      127 |         ssize_t unused = write(fd, content.constData(), size_t(content.size()));
          |                          ^~~~~
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:129:19: error: use of undeclared identifier 'SIGPIPE'
      129 |         sigaction(SIGPIPE, &oldAction, nullptr);
          |                   ^
    /home/michi/development/git/qt5/qtwayland/src/client/qwaylandprimaryselectionv1.cpp:131:5: error: use of undeclared identifier 'close'
      131 |     close(fd);
          |     ^
    8 errors generated.
    ninja: build stopped: subcommand failed.

Change-Id: Iee791fa5bc83184a597e95ae6424f42bfe2efd25
Reviewed-by: David Redondo <qt@david-redondo.de>
This commit is contained in:
Michael Weghorn 2025-04-13 21:07:48 +02:00
parent f5a940a34f
commit 3dc73f701b
2 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,8 @@
#include <qpa/qplatformclipboard.h> #include <qpa/qplatformclipboard.h>
#include <signal.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace QtWaylandClient { namespace QtWaylandClient {

View File

@ -10,6 +10,8 @@
#include <qpa/qplatformclipboard.h> #include <qpa/qplatformclipboard.h>
#include <signal.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace QtWaylandClient { namespace QtWaylandClient {