This causes clang to give fewer warnings of implicit declarations of
functions.
In mach/pdp/cv/cv.c, rename wr_int2() to cv_int2() because it
conflicts with wr_int2() in <object.h>.
In util/ack, rename F_OK to F_TRANSFORM because it conflicts with F_OK
for access() in <unistd.h>.
In OpenBSD, _XOPEN_SOURCE 500 forces _POSIX_C_SOURCE down to 199506,
which hides the declarations of openat() and fdopendir() and causes
compiler warnings.
Don't set _POSIX_C_SOURCE, because _XOPEN_SOURCE may set
_POSIX_C_SOURCE to a different value.
The existing code allocated 2 bytes (char*), but gtty() needs 6 bytes
(struct sgttyb), so isatty() smashed the stack and corrupted its
return address, probably causing SIGBUS or SIGSEGV.
Fix by switching to TIOCGETD, which needs 2 bytes. TIOCGETD isn't in
the manual for tty(4), but does appear in
https://minnie.tuhs.org//cgi-bin/utree.pl?file=V7/usr/sys/dev/tty.c
This fixes hilo_c.pdpv7 and hilo_mod.pdpv7 in simh-pdp11.
Change the alignment in C structs (wa, pa, sa, and so on) from 1 to 2
bytes. This prevents the SIGBUS when PDP-11 Unix V7 catches the
misalignment. This fixes hilo_p.pdpv7 in simh-pdp11.
Change ALIGN to document that sections have 2-byte alignment. This
change should have no effect, because the sections only contain 2-byte
values.
From my request at https://github.com/kstenerud/Musashi/pull/31
There was a conflict between Musahi's uint and OpenBSD's uint:
$ cc -o m68kmake m68kmake.c
$ ./m68kmake
$ cc -DM68K_COMPILE_FOR_MAME=0 -c m68kcpu.c
In file included from m68kcpu.c:565:
In file included from /usr/include/stdio.h:46:
/usr/include/sys/types.h:58:22: error: cannot combine with previous 'int'
declaration specifier
typedef unsigned int uint; /* Sys V compatibility */
^
./m68kcpu.h:75:25: note: expanded from macro 'uint'
#define uint unsigned int
^
1 error generated.
The code included <X11/Xfuncproto.h> only for _X_ATTRIBUTE_PRINTF,
which tells some compilers to check the printf format string. Remove
so ACK doesn't need any X11 headers.
Some machines don't have the X11 headers, or they need a flag like
-I/usr/X11R[67]/include to find them.
em libmon vanished decades ago (or never existed), and also ass appears to have
a different idea of what the em opcodes are to everything else and gets
confused.
This changes the BDOS call from CPM_BDOS_CONSOLE_INPUT to
CPN_BDOS_READ_CONSOLE_BUFFER. This allows commands like ^H to delete
characters and ^C to exit to CCP. This is more like how Unix read(2)
uses canonical mode of termios to read a line.
This change has a disadvantage: the user buffer to read(2) must now be
large enough for an entire line. This is because CP/M, unlike Unix,
lacks a kernel buffer to hold the rest of the line. If you use a
buffered input library like stdio to call read(2), then it works; but
if you try to read part of a line or a single character, then it
doesn't work.
Add a variable %{ackldflags} so I can pass `-fp`. This change seems
to cause the build to relink every ackprogram, because the link now
needs to use %{ackldflags} even if the flags are empty.
mandelbrot_c_cpm runs in YAZE-AG; startrek_c_cpm doesn't run because
it doesn't fit in the 16-bit address space.
Old .o files stop working if they use floating point. One must
recompile those files. Old files don't call libfp in the correct way,
and may use symbols that I removed from libem. I don't keep old
symbols in libem/flp.s, because a program that pulls both libfp and
flp.s would get "multiply defined" errors in the linker.
I teach mach/i80/ncg/table to use libfp by copying or adapting the
patterns from mach/i86/ncg/table. I did not test all the patterns,
but I did use `ack -mcpm -fp -O4` to compile examples/mandelbrot.c,
then I ran it in the emulator YAZE-AG. It worked, but it was slow.
This library is for software floating point. The i80 back end has
never implemented floating point, and might not be ready for libfp.
This commit only builds libfp without using it.
I edit first/build.lua and plat/build.lua to allow `ack -c.s`, then
use FP.script to edit the assembly code. I edit FP.script so it
writes the edited assembly code to stdout, not to the input file.