This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Generate string.h and time.h if nonexistent; kill POSIX
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Generate string.h and time.h if nonexistent; kill POSIX
- From: "Zack Weinberg" <zackw at Stanford dot EDU>
- Date: Mon, 7 May 2001 01:53:23 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200105011550.LAA29047@caip.rutgers.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.
--
zw A man who has never gone to school may steal from a freight car, but if he
has a university education, he may steal the whole railroad.
-- Theodore Roosevelt