any1 / neatvnc

A liberally licensed VNC server library with a clean interface
ISC License
118 stars 29 forks source link

Unbreak build on BSDs #65

Closed jbeich closed 2 years ago

jbeich commented 2 years ago

Regressed by f20ffb5e1efe. IPPROTO_TCP requires <netinet/in.h> while TCP_NODELAY requires <netinet/tcp.h>, both on Linux (glibc, musl) and on BSDs (DragonFly, FreeBSD, NetBSD, OpenBSD). Likely missed due to header bootlegging. To investigate on Linux (where it builds fine "as is") inject #error into <netinet/in.h> to let compiler show intermediate headers.

See also https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html

$ meson setup /tmp/neatvnc_build
$ meson compile -C /tmp/neatvnc_build
[...]
src/server.c:1119:17: error: use of undeclared identifier 'IPPROTO_TCP'
        setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
                       ^
any1 commented 2 years ago

Thanks!