# HG changeset patch # User jwe # Date 1193206540 0 # Node ID ad2aaf824128a46410a1989fe58943795f99c656 # Parent c344920f9e9d5d3b4999994796f2d56d0ebfbad6 [project @ 2007-10-24 06:15:39 by jwe] diff -r c344920f9e9d -r ad2aaf824128 ChangeLog --- a/ChangeLog Wed Oct 24 04:39:57 2007 +0000 +++ b/ChangeLog Wed Oct 24 06:15:40 2007 +0000 @@ -1,3 +1,8 @@ +2007-10-24 John W. Eaton + + * aclocal.m4 (OCTAVE_STRPTIME_BROKEN): New macro. + * configure.in: Use it. + 2007-10-23 John W. Eaton * configure.in: When checking for -lf2c, set F2CLIBS instad of diff -r c344920f9e9d -r ad2aaf824128 aclocal.m4 --- a/aclocal.m4 Wed Oct 24 04:39:57 2007 +0000 +++ b/aclocal.m4 Wed Oct 24 06:15:40 2007 +0000 @@ -117,6 +117,33 @@ AC_LANG_POP(C++) ]) dnl +dnl Check for broken strptime +dnl +AC_DEFUN(OCTAVE_STRPTIME_BROKEN, +[AC_CACHE_CHECK([whether strptime is broken], +octave_cv_strptime_broken, +[AC_LANG_PUSH(C) +AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#define _XOPEN_SOURCE +#if defined (HAVE_SYS_TYPES_H) +#include +#if defined (HAVE_UNISTD_H) +#include +#endif +#endif +#include +#include +]], [[ +struct tm t; +char *q = strptime ("09/13", "%m/%d/%y", &t); +return q ? 1 : 0; +]])], [octave_cv_strptime_broken=no], [octave_cv_strptime_broken=yes])]) +if test $octave_cv_strptime_broken = yes; then +AC_DEFINE(OCTAVE_HAVE_BROKEN_STRPTIME, 1, [Define if strptime is broken on your system]) +fi +AC_LANG_POP(C) +]) +dnl dnl The following test is from Karl Berry's Kpathseach library. I'm dnl including it here in case we someday want to make the use of dnl kpathsea optional. diff -r c344920f9e9d -r ad2aaf824128 configure.in --- a/configure.in Wed Oct 24 04:39:57 2007 +0000 +++ b/configure.in Wed Oct 24 06:15:40 2007 +0000 @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.584 $) +AC_REVISION($Revision: 1.585 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1493,6 +1493,7 @@ ;; esac +OCTAVE_STRPTIME_BROKEN OCTAVE_SMART_PUTENV case "$canonical_host_type" in diff -r c344920f9e9d -r ad2aaf824128 liboctave/ChangeLog --- a/liboctave/ChangeLog Wed Oct 24 04:39:57 2007 +0000 +++ b/liboctave/ChangeLog Wed Oct 24 06:15:40 2007 +0000 @@ -1,3 +1,7 @@ +2007-10-24 John W. Eaton + + * strptime.c: Also compile if OCTAVE_HAVE_BROKEN_STRPTIME is defined. + 2007-10-23 John W. Eaton * CRowVector.cc (operator * const ComplexRowVector&, const diff -r c344920f9e9d -r ad2aaf824128 liboctave/oct-time.cc --- a/liboctave/oct-time.cc Wed Oct 24 04:39:57 2007 +0000 +++ b/liboctave/oct-time.cc Wed Oct 24 06:15:40 2007 +0000 @@ -379,7 +379,7 @@ octave_base_tm::init (&t); #if defined (HAVE_STRUCT_TM_TM_ZONE) - delete ps; + delete [] ps; #endif } diff -r c344920f9e9d -r ad2aaf824128 liboctave/strptime.c --- a/liboctave/strptime.c Wed Oct 24 04:39:57 2007 +0000 +++ b/liboctave/strptime.c Wed Oct 24 06:15:40 2007 +0000 @@ -27,7 +27,7 @@ # include #endif -#ifndef HAVE_STRPTIME +#if ! defined (HAVE_STRPTIME) || defined (OCTAVE_HAVE_BROKEN_STRPTIME) #include #ifdef _LIBC