sys/time.h C++ compilation problem

MATSUMURA Hiromitsu coji2@mb.infoweb.ne.jp
Sun Sep 3 06:09:00 GMT 2000


> > > When I complied the C++ program that includes sys/time.h,
> > > following error message was printed.
> > > 
> > > /usr/include/sys/time.h:69: two or more data types in declaration of `__tz'
> > 
> > I have just found the same problem, and it only affects c++
> > programs.
> 
> I cannot reproduce this.  It must be a problem in the older compiler
> while handling __restrict.  Try moving the __restrict keyword in the
> typedefs of __timezone_ptr_t.

I succeeded in the compilation by c++(gcc-2.95.2). Thank you.
I want to check, is my change of sys/time.h correct ?


*** time.h.org  Sun Sep  3 05:48:37 2000
--- time.h      Sun Sep  3 06:07:26 2000
***************
*** 55,63 ****
    };
  
  #if defined __USE_GNU || defined __USE_BSD
! typedef struct timezone *__timezone_ptr_t;
  #else
! typedef void *__timezone_ptr_t;
  #endif
  
  /* Get the current time of day and timezone information,
--- 55,63 ----
    };
  
  #if defined __USE_GNU || defined __USE_BSD
! typedef struct timezone *__restrict __timezone_ptr_t;
  #else
! typedef void *__restrict __timezone_ptr_t;
  #endif
  
  /* Get the current time of day and timezone information,
***************
*** 66,72 ****
     NOTE: This form of timezone information is obsolete.
     Use the functions and variables declared in <time.h> instead.  */
  extern int gettimeofday (struct timeval *__restrict __tv,
!                        __timezone_ptr_t __restrict __tz) __THROW;
  
  /* Set the current time of day and timezone information.
     This call is restricted to the super-user.  */
--- 66,72 ----
     NOTE: This form of timezone information is obsolete.
     Use the functions and variables declared in <time.h> instead.  */
  extern int gettimeofday (struct timeval *__restrict __tv,
!                        __timezone_ptr_t __tz) __THROW;
  
  /* Set the current time of day and timezone information.
     This call is restricted to the super-user.  */

--
MATSUMURA Hiromitsu


More information about the Libc-alpha mailing list