This is the mail archive of the gcc-patches@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: Generate string.h and time.h if nonexistent; kill POSIX


 > From: "Zack Weinberg" <zackw@Stanford.EDU>
 > 
 > On Tue, May 01, 2001 at 11:50:11AM -0400, Kaveh R. Ghazi wrote:
 > > 
 > > IIRC, some platform's sys/time.h required including sys/types.h
 > > beforehand.  I would stick types.h in the constructed time.h.  No need
 > > to check for it, all platforms apparently have one.  It doesn't hurt
 > > to forward declare "struct tm" in that clause too, even if it already
 > > comes on a platform.  Something like this:
 > > 
 > >  >        # It does, so include it and hope it has the appropriate
 > >  >        # type declarations.
 > >  >        echo '#include <sys/types.h>' >>tmp.h
 > >  >        echo '#include <sys/time.h>' >>tmp.h
 > >  >        echo 'struct tm;' >>tmp.h
 > 
 > I'm nervous about this.  This header will be used by tsystem.h
 > which already includes sys/types.h.  What if it's not safe to
 > include sys/types.h twice?  I don't think fixincludes/fixproto try
 > to add MI guards to headers that lack them.

Well, I can offer examples where we include it twice and have not seen
any problems in practice.  E.g. system.h + cpplib.h both include
sys/types.h, so IMHO its safe.

Do you have access to any system that is actually missing time.h where
this would come up?  We might be wasting time over a moot point. :-)

		--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]