[ILUG] C compilation error

Nick Murtagh murtaghn at tcd.ie
Sun Jan 27 12:58:40 GMT 2002


On Sunday 27 January 2002 11:20, Niall O Broin wrote:
> and on the SuSE 7.3 box it begins like this
>
> #ifndef _SYS_TIME_H
> #define _SYS_TIME_H	1
>
> #include <features.h>
>
> #include <bits/types.h>
> #define __need_time_t
> #include <time.h>

the #define __need_time_t means that <time.h> skips over 
pretty much everything except the definition of time_t.
This is Mandrake 8.1 btw...

#ifndef _TIME_H

#if (! defined __need_time_t && !defined __need_clock_t && \
     ! defined __need_timespec)
# define _TIME_H        1

[...]

#ifdef  _TIME_H
/* Used by other time functions.  */
struct tm
{
  int tm_sec;                   /* Seconds.     [0-60] (1 leap second) */
  int tm_min;                   /* Minutes.     [0-59] */

[etc]

so if __need_time_t is defined, _TIME_H is not defined, and struct tm won't
make it....




More information about the ILUG mailing list