[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: HAVE_GMTIME_R?



masarati@aero.polimi.it schrieb:
masarati@aero.polimi.it writes:
The code is littered with tests like #ifdef HAVE_GMTIME_R, but there's
no
longer tests for gmtime_r() in configure.  Is it time to cleanup a bit?
Grepping some OpenLDAP versions, I'm not sure there ever was a test for
it.  #Define it if everything protected by gmtime_mutex can be avoided.
(gmtime_r, localtime_r, anything else?)  After checking that the #ifdef
HAVE_GMTIME_R branches (still) work, of course.  Should probably also
check that the prototype is as expected, in case there have been
multiple versions as with 'int strerror_r()' vs 'char *strerror_r()'.

Builds fine with -DHAVE_GMTIME_R=1; on my Linux gmtime_r() is defined
according to its use in OpenLDAP, but I have no means to check for
conformance in other systems.
possibly gmtime_r() as well as localtime_r() and other *_r() library calls could be handled similar to ctime_r() in pkg/ldap/libraries/libldap/util-int.c to assure compatibility regarding systems that do support the *_r version...

I've already tested this (just for fun) using localtime_r(): therefor I've successfully defined an additional autoconf macro in build/openldap.m4. Although autoreconf followed by ./config.status seemed to work fine I'm not sure whether I've understood the OL build system correctly.

Cheers
Daniel