|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|