vcraps for System V (here it is)

Steven L. Baur baur at venice.SEDD.TRW.COM
Wed Aug 29 20:30:47 AEST 1990


Ultrix loses horribly on the game as distributed.  A whole bunch of typecheck
messages on enum comparisons.  Oh well, Ultrix is a pretty losing OS anyway.

It compiles fine on SunOS 4.1 without change and on a UNIXPC after srandom,
random, bcopy, and index are taken care of (see following patches).
Bear in mind though, that the display is *faster* over 1200 baud to a SUN
4/370 then locally to a UNIXPC.

The file Makefile should replace entirely the distributed Makefile.  The
file usg.h is new.  The file patches should be applied via patch(1).
All the patch does is include usg.h if on a system V machine, and this is
specified in the new Makefile.

These changes are in the public domain, do what you will with them.

---------------------------Cut here-----------------------------------------
#!/bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #!/bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	patches
#	Makefile
#	usg.h
# This archive created: Wed Aug 29 03:13:13 1990
export PATH; PATH=/bin:$PATH
if test -f 'patches'
then
	echo shar: over-writing existing file "'patches'"
fi
cat << \SHAR_EOF > 'patches'
*** vcraps.c~	Wed Aug 29 02:28:10 1990
--- vcraps.c	Wed Aug 29 02:28:40 1990
***************
*** 2,7 ****
--- 2,11 ----
  #include <curses.h>
  #include <setjmp.h>
  
+ #ifdef USG
+ #include <usg.h>
+ #endif
+ 
  #define MSGQUEUELEN (20)
  
  extern int      CrapsErrorDatum;
SHAR_EOF
if test -f 'Makefile'
then
	echo shar: over-writing existing file "'Makefile'"
fi
cat << \SHAR_EOF > 'Makefile'
#
# Visual Craps package from comp.sources.games
#
# Enhancements by SB.

CC = gcc -fpcc-struct-return
# CC = cc

DEBUGFLAGS = -O
# DEBUGFLAGS = -g

# Use the first for System V, the second for BSD
OSVER = -DUSG
# OSVER = 

CFLAGS = -I. $(DEBUGFLAGS) $(OSVER)

# The first is for UNIXPC with GCC
# Want to link shared library, but GCC doesn't know how to hack around TAM
LIBS = /usr/local/lib/gcc-gnulib
# LIBS = 

# For UNIXPC
LD = shcc
# LD = cc

vcraps: crapslib.o vcraps.o
	$(LD) $(CFLAGS) -o vcraps vcraps.o crapslib.o $(LIBS) -lcurses -ltermlib

vcraps.o: vcraps.c crapslib.h
	$(CC) $(CFLAGS) -c vcraps.c

crapslib.o: crapslib.c crapslib.h
	$(CC) $(CFLAGS) -c crapslib.c

clean:
	-rm -f vcraps *.o *.a *~ *.BAK *.CKP core a.out mon.out gmon.out

shar:
	shar -n1 -e2 README Makefile crapslib.c crapslib.h > craps.1.shar
	shar -n2 -e2 vcraps.c > craps.2.shar
SHAR_EOF
if test -f 'usg.h'
then
	echo shar: over-writing existing file "'usg.h'"
fi
cat << \SHAR_EOF > 'usg.h'
/* Added by steve at romulus.sedd.trw.com 8/29/90 for System V */

/* Index doesn't exist anymore */
# define index(s, c) strchr(s, c)

/* Use memcpy instead of bcopy */
# define bcopy(from, to, size)	memcpy(to, from, size)

/* Use a different random number generator */
# define srandom(n)	srand48(n)
# define random		lrand48
SHAR_EOF
#	End of shell archive
exit 0



More information about the Comp.sys.att mailing list