fix(headers): sys/timerfd.h must compile in plain C (unblocks Wayland/glib)
cbindgen auto-generated the timerfd_* prototypes from the Rust signatures, emitting a bare 'itimerspec' (not 'struct itimerspec') and a 'clockid_t' parameter with no <time.h> in scope, so any C program that #includes <sys/timerfd.h> failed to compile. That made meson's TFD_CLOEXEC feature probe report NO and aborted the whole Wayland stack (libwayland) and glib. Exclude the auto-generated prototypes (the hand-written, correct ones are emitted from the trailer) and add <time.h> to the sys_includes.
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
# in relibc. It is required by Qt6 for QSocketNotifier and many other
|
||||
# C programs that use timer file descriptors.
|
||||
#
|
||||
# Includes the itimerspec from <time.h>.
|
||||
sys_includes = ["signal.h", "stdint.h", "stddef.h"]
|
||||
# Includes clockid_t and struct itimerspec from <time.h>.
|
||||
sys_includes = ["signal.h", "stdint.h", "time.h", "stddef.h"]
|
||||
include_guard = "_SYS_TIMERFD_H"
|
||||
trailer = """
|
||||
#ifndef TFD_CLOEXEC
|
||||
@@ -36,3 +36,12 @@ cpp_compat = true
|
||||
|
||||
[enum]
|
||||
prefix_with_name = true
|
||||
|
||||
# Do NOT auto-generate C prototypes from the Rust fn signatures: cbindgen
|
||||
# renders them with a bare `itimerspec` (rather than `struct itimerspec`) and a
|
||||
# `clockid_t` parameter, neither of which resolves in a plain C99 include of this
|
||||
# header, which broke every consumer that probes it (e.g. libwayland's
|
||||
# TFD_CLOEXEC feature test, gating the whole Wayland stack). The hand-written,
|
||||
# correct prototypes are emitted from the `trailer` above instead.
|
||||
[export]
|
||||
exclude = ["timerfd_create", "timerfd_settime", "timerfd_gettime"]
|
||||
|
||||
Reference in New Issue
Block a user