Re: [xslt] libxslt won't compile under cygwin



In message <20010913043758.C5880@debian>
          Thomas Broyer <tbroyer@ltgt.net> wrote:

> Le 13/09/01 03:53:41, Justin Fletcher a écrit :
> > >       * Calling localtime() has the side-effect of setting timezone.
> > >       * After we know the timezone, we can adjust for it
> > >       */
> > > -    lmt = gmt - timezone;
> > > +    lmt = gmt - _timezone;
> >
> > ISTR that timezone was discussed recently on this list.
> >
> > Certainly calling localtime() under RISC OS has no effect on the global
> > timezone, and attempting to reference it provokes an undefined symbol
> > error at link time.
>
> Does libexslt/date.c compiles and does the platform have the time()

Initially, yes. Because neither HAVE_TIME, nor HAVE_GMTIME were defined...

This is, I guess a reasonable test that if time components aren't available
things still work... the following warnings were thrown up (amongst others
which mostly relate to narrowing casts) :

"c.date", line 591: Warning: inventing 'extern int memset();'
"c.date", line 2169: Warning: static 'exsltDateDateTime' declared but not used
"c.date", line 2169: Warning: static 'exsltDateFormatDateTime' declared but not used

They're not that important. The memset just means you need to include
<stdlib.h>

Once HAVE_TIME and HAVE_GMTIME were defined, WITH_TIME becomes active in
libexslt, and the latter two of those errors go away.

> function? If not, what happens if you replace the call to time() with calls
> to gettimeofday()?
>
> libexslt/date.c doesn't use the timezone variable (thanks to Charlie
> Bozeman for the trick). If it works (try using date:date-time() in a
> stylesheet, it should return the current date/time, it returns an empty
> string if the platform isn't supported), then xsltFunctionLocalTime could
> use the same workaround.

Minor thing:

exsltDateCurrent calls :

    ret = exsltDateCreateDate();

But does not check that ret is valid before assigning to it a couple of lines
later.




More importantly:

#define VALID_MDAY(dt)						\
	(((dt->mon == 2) && !IS_LEAP(dt->year) && (dt->day <= 28)) ||\
	 (dt->day == daysInMonth[dt->mon - 1]))

should say :
#define VALID_MDAY(dt)						\
	(((dt->mon == 2) && !IS_LEAP(dt->year) && (dt->day <= 28)) ||\
	 (dt->day <= daysInMonth[dt->mon - 1]))

otherwise VALID_MDAY is only valid in February and on the last day of the
month.

... and now I get valid information out of it :-)


[modified source file emailed]

-- 
Gerph {djf0-.3w6e2w2.226,6q6w2q2,2.3,2m4}
URL: http://www.movspclr.co.uk/
... Eyes to the heavens, screaming at the sky;
    Trying to send you messages, but choking on goodbye.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]