Build failure on recent FreeBSD head (future 14.0-RELEASE)
Summary
libinput fails to build on latest FreeBSD due to a #define clash.
Steps to reproduce
On a FreeBSD system installed from sources including this commit:
https://cgit.freebsd.org/src/commit/?id=af93fea710385b2b11f0cabd377e7ed6f3d97c34
libinput will fail with this error:
../tools/libinput-record.c:2580:2: error: expected identifier
NOFILE,
^
/usr/include/sys/param.h:133:17: note: expanded from macro 'NOFILE'
#define NOFILE OPEN_MAX /* max open files per process */
^
/usr/include/sys/syslimits.h:60:22: note: expanded from macro 'OPEN_MAX'
#define OPEN_MAX 64 /* max open files per process */
^
1 error generated.
Required information
- libinput version: 1.24.0
- hardware information: FreeBSD 14 head after commit af93fea710385b2b11f0cabd377e7ed6f3d97c34
The indicated commit adds a /usr/include/sys/timerfd.h include to FreeBSD, which causes the params.h include to be imported too.
FreeBSD params.h defines NOFILE, causing the error.
This is being fixed in FreeBSD changing the enum to use NO_FILE
.
The patch can be seen here:
https://cgit.freebsd.org/ports/tree/x11/libinput/files/patch-tools_libinput-record.c
I'd like to have this fix, or an equivalent one, included in the upstream sources.
I have a restricted account, but once I get the limitation removed, I'll also file a pull request.
Thanks in advance!