This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: #define POSIX, string.h and time.h
- To: zackw at Stanford dot EDU
- Subject: Re: #define POSIX, string.h and time.h
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 19 Mar 2001 18:21:17 -0500 (EST)
- Cc: gcc at gcc dot gnu dot org, ghazi at caip dot rutgers dot edu
> From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
>
> Creating time.h from scratch is more complicated cause it defines
> time_t, clock_t, and various other structs and typedefs for which we
> don't know the definition. I think all uses of e.g. "struct tm" for
> the functions inserted by fix-header are pointers, so we could get
> away with just stating "struct tm;" at the beginning of our fabricated
> time.h. But I'm not sure how to handle the time_t/clock_t typedefs
> and their associated uses in the prototypes unless we decided to
> create a __TIME_TYPE__ and __CLOCK_TYPE__ like we already do for
> __SIZE_TYPE__.
I suppose we could tack "#include <sys/types.h>" at the top of the
fabricated time.h and hope it defines time_t/clock_t. It probably
violates some namespace rule for extra stuff we'll import, but that's
the best fallback I can think of.
You'll want to explicitly test all of this. I don't have access to
any boxes missing string.h or time.h. Maybe you could fake it on a
private box by hiding those files temporarily and running the fix*
process. :-) Perhaps we can get someone with an old BSD system to help
test this.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions