Index: ext/standard/config.m4 =================================================================== RCS file: /repository/php-src/ext/standard/config.m4,v retrieving revision 1.80.2.3 diff -u -p -d -r1.80.2.3 config.m4 --- ext/standard/config.m4 4 Jan 2006 21:31:29 -0000 1.80.2.3 +++ ext/standard/config.m4 24 Aug 2006 10:03:24 -0000 @@ -477,6 +477,26 @@ if test "$ac_cv_huge_val_nan" = "yes"; t AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN]) fi +AC_CACHE_CHECK(whether strptime() declaration fails, ac_cv_strptime_decl_fails,[ + AC_TRY_COMPILE([ +#include + ],[ +#ifndef HAVE_STRPTIME +#error no strptime() on this platform +#else +/* use invalid strptime() declaration to see if it fails to compile */ +int strptime(const char *s, const char *format, struct tm *tm); +#endif + ],[ + ac_cv_strptime_decl_fails=no + ],[ + ac_cv_strptime_decl_fails=yes + ]) +]) +if test "$ac_cv_strptime_decl_fails" = "yes"; then + AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], 1, [whether strptime() declaration fails]) +fi + PHP_CHECK_I18N_FUNCS PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \ Index: ext/standard/datetime.c =================================================================== RCS file: /repository/php-src/ext/standard/datetime.c,v retrieving revision 1.134.2.2.2.1 diff -u -p -d -r1.134.2.2.2.1 datetime.c --- ext/standard/datetime.c 20 Aug 2006 18:20:07 -0000 1.134.2.2.2.1 +++ ext/standard/datetime.c 24 Aug 2006 10:03:24 -0000 @@ -20,10 +20,6 @@ /* $Id: datetime.c,v 1.134.2.2.2.1 2006/08/20 18:20:07 iliaa Exp $ */ -#if HAVE_STRPTIME -#define _XOPEN_SOURCE -#endif - #include "php.h" #include "zend_operators.h" #include "datetime.h" @@ -85,6 +81,10 @@ PHPAPI char *php_std_date(time_t t TSRML #if HAVE_STRPTIME +#ifndef HAVE_STRPTIME_DECL_FAILS +char *strptime(const char *s, const char *format, struct tm *tm); +#endif + /* {{{ proto string strptime(string timestamp, string format) Parse a time/date generated with strftime() */ PHP_FUNCTION(strptime)