From 08eca96e71d96ad1f8e9b888875ab5570f208d19 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Wed, 17 Feb 2021 14:05:02 -0500 Subject: Get all the games compiling for iOS --- tetris/Makefile | 21 ++++++++++++++------- tetris/input.c | 2 ++ tetris/scores.c | 12 +++++++----- tetris/screen.c | 2 ++ 4 files changed, 25 insertions(+), 12 deletions(-) (limited to 'tetris') diff --git a/tetris/Makefile b/tetris/Makefile index 43112240..aeda79a9 100644 --- a/tetris/Makefile +++ b/tetris/Makefile @@ -4,12 +4,19 @@ PROG= tetris SRCS= input.c screen.c shapes.c scores.c tetris.c MAN= tetris.6 -DPADD= ${LIBTERMINFO} -LDADD= -lterminfo -HIDEGAME=hidegame -SETGIDGAME=yes -COPTS.tetris.c+= ${GCC_NO_FORMAT_TRUNCATION} -COPTS.scores.c+= ${GCC_NO_FORMAT_TRUNCATION} +all: $(PROG) -.include +$(PROG): $(SRCS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(STRIP) $(PROG) + +install: $(PROG) $(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/var/games + +clean: + rm -f $(CLEANFILES) $(PROG) + +.PHONY: all clean install diff --git a/tetris/input.c b/tetris/input.c index e5f8c12a..65741e5c 100644 --- a/tetris/input.c +++ b/tetris/input.c @@ -48,6 +48,8 @@ #include "input.h" #include "tetris.h" +#define INFTIM (-1) + /* return true iff the given timeval is positive */ #define TV_POS(tv) \ ((tv)->tv_sec > 0 || ((tv)->tv_sec == 0 && (tv)->tv_usec > 0)) diff --git a/tetris/scores.c b/tetris/scores.c index 1335df7b..dc791612 100644 --- a/tetris/scores.c +++ b/tetris/scores.c @@ -58,6 +58,8 @@ #include "scores.h" #include "tetris.h" +#include + /* * Allow updating the high scores unless we're built as part of /rescue. */ @@ -220,9 +222,9 @@ scorefile_probe(int sd) } /* None was a valid level; try opposite endian */ - offset64 = bswap32(offset64); - offset60 = bswap32(offset60); - offset56 = bswap32(offset56); + offset64 = OSSwapInt32(offset64); + offset60 = OSSwapInt32(offset60); + offset56 = OSSwapInt32(offset56); if (offset64 >= MINLEVEL && offset64 <= MAXLEVEL) { /* 40-byte structure */ @@ -267,7 +269,7 @@ static int32_t read32(int32_t val, int doflip) { if (doflip) { - val = bswap32(val); + val = OSSwapInt32(val); } return val; } @@ -276,7 +278,7 @@ static int64_t read64(int64_t val, int doflip) { if (doflip) { - val = bswap64(val); + val = OSSwapInt64(val); } return val; } diff --git a/tetris/screen.c b/tetris/screen.c index bc065aaa..d723b54e 100644 --- a/tetris/screen.c +++ b/tetris/screen.c @@ -50,6 +50,8 @@ #include #include +#include + #ifndef sigmask #define sigmask(s) (1 << ((s) - 1)) #endif -- cgit v1.2.3-56-ge451