diff options
author | Pedro F. Giffuni <giffunip@tutopia.com> | 2012-08-16 17:16:05 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2012-08-16 17:16:05 +0800 |
commit | bda37db361159222a9ecd05237c05b839c3f2654 (patch) | |
tree | 608b6457dc36ea9a1453fc91e4c278ce3959f777 | |
parent | e669a8c7cefec93ee1bfaf59721aadc42e226d6e (diff) | |
download | libxslt-bda37db361159222a9ecd05237c05b839c3f2654.tar.gz libxslt-bda37db361159222a9ecd05237c05b839c3f2654.tar.bz2 libxslt-bda37db361159222a9ecd05237c05b839c3f2654.zip |
FreeBSD portability fixes
Around behaviour and compile flags for localtime and EXSLT date support
-rw-r--r-- | libexslt/date.c | 2 | ||||
-rw-r--r-- | libxslt/extra.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/libexslt/date.c b/libexslt/date.c index 05b11ed3..b692bb42 100644 --- a/libexslt/date.c +++ b/libexslt/date.c @@ -28,7 +28,7 @@ #include "config.h" #endif -#if HAVE_LOCALTIME_R /* _POSIX_SOURCE required by gnu libc */ +#if defined(HAVE_LOCALTIME_R) && defined(__GLIBC__) /* _POSIX_SOURCE required by gnu libc */ #ifndef _AIX51 /* but on AIX we're not using gnu libc */ #define _POSIX_SOURCE #endif diff --git a/libxslt/extra.c b/libxslt/extra.c index 3a0f547c..f00b0012 100644 --- a/libxslt/extra.c +++ b/libxslt/extra.c @@ -243,8 +243,11 @@ xsltFunctionLocalTime(xmlXPathParserContextPtr ctxt, int nargs) { * Calling localtime() has the side-effect of setting timezone. * After we know the timezone, we can adjust for it */ +#if !defined(__FreeBSD__) lmt = gmt - timezone; - +#else /* FreeBSD DOESN'T have such side-ffect */ + lmt = gmt - local_tm->tm_gmtoff; +#endif /* * FIXME: it's been too long since I did manual memory management. * (I swore never to do it again.) Does this introduce a memory leak? |