Skip to content
Snippets Groups Projects
Commit dcf4cef0 authored by Miro Hrončok's avatar Miro Hrončok Committed by Simon McVittie
Browse files

Add missing <unistd.h> includes for Python 3.13+ compatibility

According to https://docs.python.org/3.13/whatsnew/3.13.html:

> Python.h no longer includes the <unistd.h> standard header file.
> If needed, it should now be included explicitly.
> For example, it provides the functions: read(), write(), close(),
> isatty(), lseek(), getpid(), getcwd(), sysconf() and getpagesize().
> (Contributed by Victor Stinner in
> https://github.com/python/cpython/issues/108765

)

The build failures with -Werror=implicit-function-declaration were:

    .../dbus_bindings/unixfd.c: In function 'UnixFd_tp_new':
    .../dbus_bindings/unixfd.c:146:10: error: implicit declaration of function 'dup' [-Werror=implicit-function-declaration]
      146 |     fd = dup(fd_original);
          |          ^~~
    .../dbus_bindings/unixfd.c:146:10: warning: nested extern declaration of 'dup' [-Wnested-externs]
    .../dbus_bindings/unixfd.c:154:9: error: implicit declaration of function 'close'; did you mean 'clone'? [-Werror=implicit-function-declaration]
      154 |         close(fd);
          |         ^~~~~
          |         clone

[smcv: Adjust include order, don't include unistd.h on Windows]
Co-authored-by: default avatarSimon McVittie <smcv@collabora.com>
parent 0d4415c1
No related branches found
No related tags found
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment