From: Wouter Wijngaards Date: Mon, 5 Dec 2011 14:41:17 +0000 (+0000) Subject: Fix with localtime_r compat. X-Git-Tag: release-1.6.12~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce6b5b3ba37f6f5179408c8e3fdb2aa81ef4e41f;p=thirdparty%2Fldns.git Fix with localtime_r compat. --- diff --git a/compat/localtime_r.c b/compat/localtime_r.c new file mode 100644 index 00000000..017c6e4d --- /dev/null +++ b/compat/localtime_r.c @@ -0,0 +1,14 @@ +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_TIME_H +#include +#endif + +struct tm *localtime_r(const time_t *timep, struct tm *result) +{ + /* no thread safety. */ + *result = *localtime(timep); + return result; +} diff --git a/configure.ac b/configure.ac index 9c492456..07eb4587 100644 --- a/configure.ac +++ b/configure.ac @@ -470,6 +470,7 @@ AC_REPLACE_FUNCS(calloc) AC_REPLACE_FUNCS(timegm) AC_REPLACE_FUNCS(gmtime_r) AC_REPLACE_FUNCS(ctime_r) +AC_REPLACE_FUNCS(localtime_r) AC_REPLACE_FUNCS(isblank) AC_REPLACE_FUNCS(isascii) AC_REPLACE_FUNCS(inet_aton) @@ -601,6 +602,9 @@ time_t timegm (struct tm *tm); #ifndef HAVE_GMTIME_R struct tm *gmtime_r(const time_t *timep, struct tm *result); #endif +#ifndef HAVE_LOCALTIME_R +struct tm *localtime_r(const time_t *timep, struct tm *result); +#endif #ifndef HAVE_ISBLANK int isblank(int c); #endif /* !HAVE_ISBLANK */