# Makefile for the open-source release of adventure 2.5
+CCFLAGS=-std=c99
LIBS=-lrt
UNAME_S := $(shell uname -s)
GCCVERSIONGTEQ4 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 4)
SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO adventure.text advent.text control misc.h main.h share.h funcs.h
.c.o:
- $(CC) -O $(DBX) -c $<
+ $(CC) $(CCFLAGS) -O $(DBX) -c $<
advent: $(OBJS) database.o
- $(CC) -Wall -std=c99 -O $(DBX) -o advent $(OBJS) database.o $(LIBS)
+ $(CC) $(CCFLAGS) -O $(DBX) -o advent $(OBJS) database.o $(LIBS)
main.o: main.h misc.h funcs.h database.h
database.c database.h: compile
./compile
- $(CC) $(OPTIONS) -O $(DBX) -c database.c
+ $(CC) $(CCFLAGS) -O $(DBX) -c database.c
clean:
rm -f *.o advent advent.html advent.6 database.[ch] compile
/* This next part is shared with the "resume" code. The two cases are
* distinguished by the value of kk (-1 for suspend, +1 for resume). */
-L8305: DATIME(I,K);
+L8305: DATIME(&I,&K);
K=I+650*K;
SAVWRD(KK,K);
K=VRSION;
#include <stdbool.h>
#include <getopt.h>
#include <signal.h>
+#include <time.h>
#include "main.h"
#include "database.h"
#include "misc.h"
L18999: RSPEAK(SPK);
L19000: RSPEAK(136);
score(0);
+ return true;
}
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <sys/time.h>
#include "main.h"
#include "share.h" /* for SETUP */
#include "misc.h"
+void DATIME(long* D, long* T) {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ *D = (long) tv.tv_sec;
+ *T = (long) tv.tv_usec;
+}
long fIABS(N)long N; {return(N<0? -N : N);}
long fMOD(N,M)long N, M; {return(N%M);}
-#include <time.h>
#include <stdio.h>
#include <stdbool.h>
#define MPINIT() fMPINIT()
extern void fSAVEIO(long,long,long*);
#define SAVEIO(OP,IN,ARR) fSAVEIO(OP,IN,ARR)
-#define DATIME(D,T) do {struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); D=ts.tv_sec, T=ts.tv_nsec;} while (0)
+extern void DATIME(long*, long*);
extern long fIABS(long);
#define IABS(N) fIABS(N)
extern long fMOD(long,long);