Replace fDATIME with ANSI/POSIX clock_gettime(). Rip out DOS/AMIGA shims.

The thinking here is that we simplify life by going pure ANSI/POSIX.
This is a text game.  If it ever runs on anything but Unix again it's
almost certain to be on something like WSL that supplies a
POSIX-conformant text console.
This commit is contained in:
Eric S. Raymond 2017-05-18 17:18:16 -04:00
parent bd0487acc5
commit 23f2dbe814
6 changed files with 5 additions and 69 deletions

11
misc.h
View file

@ -1,10 +1,8 @@
#ifdef __MSDOS__ /* define fopen modes for binary files */
#include <time.h>
/* b is not needed for POSIX but harmless */
#define READ_MODE "rb"
#define WRITE_MODE "wb"
#else
#define READ_MODE "r"
#define WRITE_MODE "w"
#endif
extern void fSPEAK(long);
#define SPEAK(N) fSPEAK(N)
@ -70,8 +68,7 @@ extern void fMPINIT();
#define MPINIT() fMPINIT()
extern void fSAVEIO(long,long,long*);
#define SAVEIO(OP,IN,ARR) fSAVEIO(OP,IN,ARR)
extern void fDATIME(long*,long*);
#define DATIME(D,T) fDATIME(&D,&T)
#define DATIME(D,T) do {struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); D=ts.tv_sec, T=ts.tv_nsec;} while (0)
extern long fIABS(long);
#define IABS(N) fIABS(N)
extern long fMOD(long,long);