In the past, we didn't use `gettimeofday()` on all non-DOS platforms
because it wasn't available, so we had to fall back to `time()`.
Those days are long gone and we have `gettimeofday()` on all non-DOS
platforms.
This also removes some code that used `times()` when it used `time()`.
This leaves us using `getrusage()` on all non-DOS platforms. This,
much like `gettimeofday()`, is now available everywhere. Not all of
the fields used here are guaranteed by POSIX, but the ones used
here shouldn't be an issue for now.
When `RELEASE` is set, then `inc/version.h` configures some
defines appropriately, including `BIGATOMS`, `BIGVM`, and
`NEWCDRCODING`. There's no need to manage it directly on
the compiler command line.
The return value of `fcntl` when passed `F_SETFL` isn't guaranteed
to return the flags passed in as its return value. It will be `-1`
in the event of an error, but no other value is to be relied upon.
Fortunately, we weren't relying upon the value apart from
occasionally checking for an error.
This is as it is specified in https://pubs.opengroup.org/onlinepubs/7908799/xsh/fcntl.htmlClosesinterlisp/medley#87.
* Always follow NEW_STORAGE code paths.
This removes the code paths for the pre-NEW_STORAGE code.
* Remove NEW_STORAGE from build system.
The code no longer refers to `NEW_STORAGE`, so we can remove
this from the build system.
This flag was for SunOS 3 and 4 on sun3 hardware (68k).
It enabled some unsafe optimizations via assembler. This hasn't
actually been built since the DOS port (since the header for this
was renamed, but the code in `xc.c` wasn't updated).
The optimizations here made assumptions that were specific to the
68k hardware and register allocation. They aren't likely to be
of much use moving forward, and we've got plenty of safe performance
improvements from the last 30 years of hardware advances.
* Use the real gethostid on Solaris.
Solaris has this, so we might as well use it like we do on other
platforms. This value is used in response to queries from it from
Lisp.
* Improve undefining of HAS_GETHOSTID.
Enable it on Solaris in `inc/version.h`. This file already
disables it on DOS, so no need to do so again in `src/initsout.c`.
Both sides of this #ifdef were the same, so just collapse it.
This code isn't actually relevant any longer, but this removes
an OS-specific #ifdef, making inspection of platform specific
code a bit easier.
This code was treating the `d_reclen` incorrectly from some of the
original old porting work. It is not the same as `d_namlen` and
`d_namlen` is not widely supported or standard. It should be using
`strlen(d_name)`.
This addresses an issue mentioned in interlisp/medley#103.
* Include <ieeefp.h> for Solaris.
* Remove sections for sparc and Sun i386 for non-Solaris.
* Have Linux use the same code as FreeBSD and macOS.
* Make the FreeBSD / Linux / macOS code path the default, if nothing
special is defined since it is the modern way.
* Remove fpstatus_() usage from the ancient days.
When `FLTINT` is defined (which is currently only on SunOS), if
`OS5` was not defined, then it tried to use `ieee_handler` which
doesn't exist on Linux and friends. If we were to enable `FLTINT`
on more platforms, then we'd want to always be using more modern
signal handling and not `ieee_handler`.
* Check.h, Stipple.h, XCursors.h, XWaitCur.h, Xcursdef.h,
Xdefcur.h, and Xicon.h were combined into xbitmaps.h.
* Xdisplay.h is not used and the contents are in MyWindow.h, which
is used.
* XVersion.h and Xdeflt.h became xdefs.h. Remove 2 stragglers
that were still including XVersion.h.
X11R1 was released in 1987 and superseded by X11R2 in 1988.
We should be able to safely remove this code. We set the
preprocessor variable on all platforms to indicate that we're
on X11R4 (or later, I guess).
`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'