* problems with time.h under Ultrix 4.x
@ 1992-01-10 23:40 Jurgen Botz
1992-01-14 0:00 ` Eiji Hirai
1992-01-14 8:45 ` Johan Vromans
0 siblings, 2 replies; 3+ messages in thread
From: Jurgen Botz @ 1992-01-10 23:40 UTC (permalink / raw)
About half the software I've compiled under Ultrix 4.x has had problems
with DEC's "time.h". Often I get 'conflicting types for "time"' errors,
but I've gotten others as well. I can usually fix it by temporarily
commenting something in DEC's header out. But seeing as that so much
software has problems there, does anyone know what DEC is doing wrong,
and/or can suggest a more permanent fix? TIA.
--
Jurgen Botz | Internet: JBotz@mtholyoke.edu
Academic Systems Consultant | Bitnet: JBotz@mhc.bitnet
Mount Holyoke College | Voice: (US) 413-538-2375 (daytime)
South Hadley, MA, USA | Snail Mail: J. Botz, 01075-0629
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problems with time.h under Ultrix 4.x
1992-01-10 23:40 problems with time.h under Ultrix 4.x Jurgen Botz
@ 1992-01-14 0:00 ` Eiji Hirai
1992-01-14 8:45 ` Johan Vromans
1 sibling, 0 replies; 3+ messages in thread
From: Eiji Hirai @ 1992-01-14 0:00 UTC (permalink / raw)
jbotz@mtholyoke.edu (Jurgen Botz) writes:
> About half the software I've compiled under Ultrix 4.x has had problems
> with DEC's "time.h".
When I compile source code from the net using gcc 1.40 in Ultrix 4.2, I
usually change the source so that functions returning the number of
seconds since 1970 return time_t instead of int or long.
So like if you have code that looks like
long now;
time(&now);
variable = localtime(&now);
then I change long to time_t.
--
Eiji Hirai <hirai@cc.swarthmore.edu> : : : : : :: ::: :::: :::::
Unix Hacker for Swarthmore College, : : : : : :: ::: :::: :::::
Computing Center, Swarthmore, PA, USA. Copyright 1992 by Eiji Hirai.
I don't speak for Swarthmore College. All Rights Reserved.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problems with time.h under Ultrix 4.x
1992-01-10 23:40 problems with time.h under Ultrix 4.x Jurgen Botz
1992-01-14 0:00 ` Eiji Hirai
@ 1992-01-14 8:45 ` Johan Vromans
1 sibling, 0 replies; 3+ messages in thread
From: Johan Vromans @ 1992-01-14 8:45 UTC (permalink / raw)
In article <1992Jan10.234037.19422@mtholyoke.edu> jbotz@mtholyoke.edu (Jurgen Botz) writes:
About half the software I've compiled under Ultrix 4.x has had problems
with DEC's "time.h". Often I get 'conflicting types for "time"' errors,
but I've gotten others as well. I can usually fix it by temporarily
commenting something in DEC's header out. But seeing as that so much
software has problems there, does anyone know what DEC is doing wrong,
and/or can suggest a more permanent fix? TIA.
'Old' software uses type long for time, current standard is time_t.
DEC has changed its sys/time.h to use time_t, which conflicts with older
software.
My personal solution is to change, in sys/time.h (actually
/usr/local/lib/gcc-include/sys/time.h since I only use GCC) :
extern time_t time( time_t *__tloc );
to:
#ifdef TIME_T_LONG
extern long time( time_t *__tloc );
#else
extern time_t time( time_t *__tloc );
#endif
When I encounter software that uses 'long time', I only have to supply
-DTIME_T_LONG on the command line.
Johan
--
Johan Vromans jv@mh.nl via internet backbones
Multihouse Automatisering bv uucp:..!{uunet,sun4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands phone/fax: +31 1820 62911/62500
------------------------ "Arms are made for hugging" -------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1992-01-14 8:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1992-01-10 23:40 problems with time.h under Ultrix 4.x Jurgen Botz
1992-01-14 0:00 ` Eiji Hirai
1992-01-14 8:45 ` Johan Vromans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox