This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: sys/time.h C++ compilation problem
- To: libc-alpha at sourceware dot cygnus dot com
- Subject: Re: sys/time.h C++ compilation problem
- From: MATSUMURA Hiromitsu <coji2 at mb dot infoweb dot ne dot jp>
- Date: Sun, 03 Sep 2000 22:10:33 +0900
> > > 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