diff options
author | cos <cos> | 2025-02-15 11:17:19 +0100 |
---|---|---|
committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2025-02-25 12:47:59 +0100 |
commit | b8b57ba75020c224ae6c5f068cd3514c9a4d7d91 (patch) | |
tree | 9cdeb178e0b2de08ea3b23303f7a7d13189a35c3 /src/core.c | |
parent | afd939e6afa79932e96950539ce108ab2c644217 (diff) | |
download | luasystem-b8b57ba75020c224ae6c5f068cd3514c9a4d7d91.tar.gz luasystem-b8b57ba75020c224ae6c5f068cd3514c9a4d7d91.tar.bz2 luasystem-b8b57ba75020c224ae6c5f068cd3514c9a4d7d91.zip |
Reverse conditional compilation of non-POSIX
As https://www.openbsd.org/faq/ports/guide.html#PortsGeneric states, it
is inappropriate to base feature inclusion on a growing list (60b66fc,
9160d12) of excluded platforms. Thus this commit attempts to switch the
assumption from Linux to a modern POSIX as the default target.
Firstly, merely checking for __unix__ should be functionally equivalent
of having a long lists of practically "all" operating systems.
Apart from Windows, the primary non-standard code covers these termios
related constants: I_IUCLC, O_OLCUC, O_OFILL, O_OFDEL, O_NLDLY, O_CRDLY
and L_XCASE.
A few of them are documented as LEGACY as they were removed from POSIX
https://pubs.opengroup.org/onlinepubs/007904875/basedefs/termios.h.html
over two decades ago. The other constants are part of the X/Open System
Interfaces, which supposedly should be available when _XOPEN_UNIX is set
to another value than -1. However on Linux they exist, yet the variable
indicating their presence is undefined.
In summary; It is hard to find any feature specific preprocessor
variables indicating availability, but it is quite safe to limit their
inclusion to Linux until patches arrive for other platforms.
Executing `cpp -dM </dev/null | grep -i linux` on contemporary glibc and
musl based distributions tend to give a few constants, where __linux__
likely is the one most suitable.
Based on the previous state of the code, the following constants are
expected to be available also on Apple: O_BSDLY, O_VTDLY and O_FFDLY.
They do not appear be documented in termios(4) on macOS 13, but they
actually exist in /Library/Developer/…/sys/termios.h.
Lastly, O_TABDLY is kept excluded exclusively for NetBSD as that is the
only currently supported platform lacking it.
Diffstat (limited to 'src/core.c')
0 files changed, 0 insertions, 0 deletions