> > > The correct thing to do instead of the #if defined (_AIX) would be to use
> > > something like #ifdef NO_NEGATIVE_MKTIME and set that with a configure.
> > ...Andreas, can you suggest a simple configure
> > test to be used?
> #include <time.h>
> int main()
> {
>     struct tm tt, *tm=&tt;
>     int i = -50000000;
>     tm = localtime (&i);
>     i = mktime (tm);
>     if (i != -50000000)   /* on AIX this check could also be (i == -1) */
>     {
>         printf("ERROR: mktime(3) does not correctly support datetimes before 1970\n");
>         return(1);
>     }
> }

On my Linux box, where the test passes, the compiler is happier if "i"
is declared as time_t. Any problem on other platforms if we change this?

                       - Thomas

Wed, 17 Jan 2001 15:26:18 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: Re: tinterval - operator problems on AIX

> > The correct thing to do instead of the #if defined (_AIX) would be to use
> > something like #ifdef NO_NEGATIVE_MKTIME and set that with a configure.
> > Thomas, are you volunteering ?
> 
> Actually, I can volunteer to be supportive of your efforts ;) I'm
> traveling at the moment, and don't have the original thread(s) which
> describe in detail what we need to do for platforms I don't have.
> 
> If Peter E. would be willing to do a configure test for this mktime()
> problem, then you or I can massage the actual code. Peter, is this
> something you could pick up?
> 
> I do not have the original thread where Andreas describes the behavior
> of mktime() on his machine. Andreas, can you suggest a simple configure
> test to be used?

#include <time.h>
int main()
{
    struct tm tt, *tm=&tt;
    int i = -50000000;
    tm = localtime (&i);
    i = mktime (tm);
    if (i != -50000000)   /* on AIX this check could also be (i == -1) */
    {
        printf("ERROR: mktime(3) does not correctly support datetimes before 1970\n");
        return(1);
    }
}

Andreas

Wed, 17 Jan 2001 16:50:37 +0100
Zeugswetter Andreas SB  <ZeugswetterA@wien.spardat.at>
AW: AW: AW: AW: Re: tinterval - operator problems on AI
	X
Zeugswetter Andreas SB writes:

> > I do not have the original thread where Andreas describes the behavior
> > of mktime() on his machine. Andreas, can you suggest a simple configure
> > test to be used?
>
> #include <time.h>
> int main()
> {
>     struct tm tt, *tm=&tt;
>     int i = -50000000;
>     tm = localtime (&i);
>     i = mktime (tm);
>     if (i != -50000000)   /* on AIX this check could also be (i == -1) */
>     {
>         printf("ERROR: mktime(3) does not correctly support datetimes before 1970\n");
>         return(1);
>     }
> }

You don't need to put this check into configure, you can just do the check
after mktime() is used.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Wed, 17 Jan 2001 17:53:03 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: AW: AW: AW: AW: Re: tinterval - operator problems on
 AI X