From eb49760603a043163b7cc80c781a16eac376aee2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 14 Apr 2007 09:14:40 +0000 Subject: r22215: add strptime replacement to libreplace based on the patch from jojowil@hvcc.edu to bug 4063 also add a testsuite for strptime() metze (This used to be commit aba64521707143e6505b3322c390882a918a148a) --- source4/lib/replace/strptime.m4 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 source4/lib/replace/strptime.m4 (limited to 'source4/lib/replace/strptime.m4') diff --git a/source4/lib/replace/strptime.m4 b/source4/lib/replace/strptime.m4 new file mode 100644 index 0000000000..0f2065fd62 --- /dev/null +++ b/source4/lib/replace/strptime.m4 @@ -0,0 +1,21 @@ +AC_CACHE_CHECK([whether strptime is available and works],libreplace_cv_STRPTIME_OK,[ + AC_TRY_RUN([ + #include + #include + #include + int main (void) { + const char *s = "20061004023546Z"; + char *ret; + struct tm t; + ret = strptime(s, "%Y%m%d%H%M%S", &t); + if ( ret == NULL ) return 1; + return 0; + }], + [libreplace_cv_STRPTIME_OK=yes], + [libreplace_cv_STRPTIME_OK=no], + [libreplace_cv_STRPTIME_OK="assuming not"]) +]) +if test x"$libreplace_cv_STRPTIME_OK" != x"yes"; then + AC_DEFINE(REPLACE_STRPTIME,1,[Whether strptime should be replaced]) + LIBREPLACEOBJ="${LIBREPLACEOBJ} strptime.o" +fi -- cgit