`timer.c` uses `F_SETSIG` which is a GNU extension. As such, it
needs `_GNU_SOURCE` to be defined, but this was only done for
x86_64, not the other Linux platforms that we have build system
support for.
Closesinterlisp/medley#97.
* Move clang/gcc options into makefile-header.
This puts all of the shared options into a single place so that
we can easily update it.
* Add -fwrapv to the clang/gcc command lines.
This is a step along the way to fixing interlisp/medley#90.
Enabling `-fwrapv` will let overflow checks that rely upon undefined
behavior to work correctly. Without this, with modern versions of
clang and gcc, the overflow checks in the C code are eliminated
by the compiler, resulting in incorrect behavior on the part of
Maiko.
See the linked bug for details and discussion.
Hopefully, this usage of `-fwrapv` will go away once we're using
the correct compiler builtins to detect and handle overflow
correctly.
CLX is a Common Lisp implementation of the X client library.
It has some code in C, which was present here as `src/socket.c`
and `src/socdvr.c`, exposed via opcodes in `src/subr.c`. This code
had been removed (with prejudice apparently) by commenting out
the code in `src/subr.c` with `#if NEVER`.
This code would've been used by the Medley system images, but
that code doesn't appear to be present. (There may or may not
be something related in `XMAS` in the Medley repository.)
* Remove static char *id = from all source files.
The same information is included in a comment in each source file.
* Remove unused template file 'id'
The FSERROR define is on all the time now. It was not controlling
all of the functionality, with many places setting Lisp_errnno
outside of the code controlled by the define.
The `open()` call can take a third argument (for when the mode
is `O_CREAT`). However, it is not needed here as we aren't
using `O_CREAT`. (And if we needed an extra arg, it wouldn't
have been `NULL`.)
* FD_ISSET requires that the fd being tested is >= 0, so unset fd -1 causes trouble.
* Remove code to enable X I/O signal generation from xinit.c
If the I/O signals are enabled before the signal handler has
been set up, the default action on receipt of a SIGPOLL or SIGIO
will be that the program exits. For now, turn the signals off,
as they aren't necessary and may not even be an improvement.
* Ensure fds are declared as signed and initialized (to -1)
The global fds may be accessed from the signal handler before any
particular device has been opened. Ensure that the fds are initialized
statically and that the value is distinguishable from all valid descriptors.
modified: initdsp.c
modified: initkbd.c
modified: keyevent.c
modified: osmsg.c
modified: rs232c.c
modified: timer.c
modified: tty.c
This wasn't enabled and the corresponding code wouldn't have
compiled. The `utime()` function is also deprecated in POSIX.
This used to be enabled for HPUX and RISCOS.
On SunOS4, we build `xc.c` by jumping through a lot of hoops to
perform a particular set of operations. We don't do that on other
platforms and this will help clean up the Linux and FreeBSD makefiles.
These directives were already not present in the macOS makefiles.
When things were renamed for DOS, `asmbitblt.c` became `asmbbt.c`,
but the old file got left around. It was never converted fully
from K&R prototypes, but apart from that, is the same as `asmbbt.c`.
Update guard name to match file name and protect entire file
Only declare extern lock variables when doing locking
Include system headers that locking macros depend on
Convert code block macros to do { } while (0) statement style
This is an internal macro to GNU libc and wasn't meant to be
defined like this. Well, it was. It was deprecated and removed
some years ago, so it isn't doing anything at all here now.
I_SETSIG is part of the STREAMS interface, which is only present
on Solaris (among our supported platforms), so simplify this check.
Other usages of I_SETSIG could be improved, but they need more
investigation and perhaps removal.