This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Historical query - time.h, sys/time.h


 > Has there ever been a system which had neither time.h nor sys/time.h?
 > zw

I'm pretty sure you've got at least one on *hosted* systems.  I can't
say for sure on freestanding ones...


The autoconf docs for TIME_WITH_SYS_TIME suggest the following
snippet:

#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif

Note it'll always include one or both of time.h & sys/time.h.

I checked and e.g. fileutils and gnutar use this style, and those are
pretty well circulated packages.  So in practice, i.e. on systems gcc
supports, you'll have at least one.

Gcc itself is more careful to wrap the last time.h include in an
ifdef, but this is being extra careful, not necessarily needed IMHO.

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]