[net.games] battlestar: I can't get it to compile!

kay@flame.UUCP (Kay Dekker) (02/06/85)

In com6.c there's a line 
struct timeval tv;
and our compiler barfs at this with "unknown size".
We're running 4.1BSD on a Vax750.  Any ideas?

					Kay.
PS: also I think our distribution got munged. This may be the problem.
-- 
"News bug? WHAT news bug?"
			... mcvax!ukc!flame!kay

rob@ark.UUCP (Rob van Leeuwen) (02/09/85)

In article <349@flame.UUCP> kay@flame.UUCP (Kay Dekker) writes:
>In com6.c there's a line 
>struct timeval tv;
>and our compiler barfs at this with "unknown size".
>We're running 4.1BSD on a Vax750.  Any ideas?

I've had the same problem.
Bringing the game up required the following steps:

(all in com6.c):
	Remove the #including of <time.h>
	Change 'struct timeval tv' to 'long tv'
	Change 'gettimeofday...' to 'time( &tv )'
	Change 'date = ctime( ...' to 'date = ctime h( &tv )'

This introduced another difficulty: for some reason the loader complained
about 'time' being multiply defined (Even after changing all occurences of
the variable 'time' (NOT the function, of course) to 'Time'!)
So I decided to #define Time XTime and changed 'Time' (formerly 'time') in
externs.h.

It wasn't all yet: change sigblock() to sighold( SIGINT )	and
			  sigsetmask() to sigrelse( SIGINT ) (also in com6.c)

That did it.

P.S.: Sorry for not sending a diff;  I removed the sharfile after
unsharring. (Silly me, being so ignorous).
-- 

					Rob van Leeuwen
					..!mcvax!vu44!botter!ark!rob

robert@gitpyr.UUCP (Robert Viduya) (02/10/85)

><
Posted from  kay@flame.UUCP (Kay Dekker)
> In com6.c there's a line 
> struct timeval tv;
> and our compiler barfs at this with "unknown size".
> We're running 4.1BSD on a Vax750.  Any ideas?
> 
> 					Kay.
> PS: also I think our distribution got munged. This may be the problem.
> -- 
> "News bug? WHAT news bug?"
> 			... mcvax!ukc!flame!kay

The problem isn't in the distribution, but in the #define's.  In either
com6.c or in one of the .h files (i forget how many there are), the
symbol TIME is defined.  In /usr/include/time.h, if the symbol TIME.H
is defined, then none of the structures declared in the include file
are compiled (look at the include file to see exactly what I mean). Cpp
considers TIME.H to be equal to TIME and so the necessary things from time.h
aren't declared resulting in the compiler error message.

Solution: do a 'grep TIME *.[ch]' in the battlestar directory to get a list
of files that it's used in and change them all to something different.  I
changed them to ZTIME, for lack of a better name.  Easiest way to do this
is probably:

	apply 'ed < ed_script' `fgrep TIME *.[ch]`
	
with the file 'ed_script' containing the following lines:

	s/[^A-Z]TIME[^A-Z]/Z&/g
	w
	q

I haven't tried this (I was in the editor when I found the problem and changed
it on the fly), but I don't see any reason why it won't work.

One last note: I'm on a 4.2BSD system, and I don't know what the differences
are, so be warned.

				robert
-- 
Robert Viduya
Georgia Institute of Technology

...!{akgua,allegra,amd,hplabs,ihnp4,masscomp,ut-ngp}!gatech!gitpyr!robert
...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally}!gatech!gitpyr!robert

robert@gitpyr.UUCP (Robert Viduya) (02/11/85)

Whoops! Slight screw up.  The file 'ed_script' should be:
 
 	1,$s/[^A-Z]TIME[^A-Z]/Z&/g
 	w
 	q
 

			robert
-- 
Robert Viduya
Georgia Institute of Technology

...!{akgua,allegra,amd,hplabs,ihnp4,masscomp,ut-ngp}!gatech!gitpyr!robert
...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally}!gatech!gitpyr!robert