# HG changeset patch # User John W. Eaton # Date 1265089912 18000 # Node ID e45ccac6017f0d28662e5f4247215258b2f6d261 # Parent 144739908eefcfa40596b1f25e29441252773493 addtional fixes for using strptime module diff -r 144739908eef -r e45ccac6017f ChangeLog --- a/ChangeLog Mon Feb 01 20:19:54 2010 +0100 +++ b/ChangeLog Tue Feb 02 00:51:52 2010 -0500 @@ -1,3 +1,8 @@ +2010-02-02 John W. Eaton + + * acinclue.m4 (OCTAVE_STRPTIME_BROKEN): Delete. + * configure.ac: Don't call it. + 2010-02-01 John W. Eaton * acinclude.m4 (OCTAVE_PROG_MAKEINFO): Delete macro. diff -r 144739908eef -r e45ccac6017f acinclude.m4 --- a/acinclude.m4 Mon Feb 01 20:19:54 2010 +0100 +++ b/acinclude.m4 Tue Feb 02 00:51:52 2010 -0500 @@ -106,33 +106,6 @@ 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 144739908eef -r e45ccac6017f configure.ac --- a/configure.ac Mon Feb 01 20:19:54 2010 +0100 +++ b/configure.ac Tue Feb 02 00:51:52 2010 -0500 @@ -1554,7 +1554,6 @@ esac OCTAVE_HAVE_C99_VSNPRINTF -OCTAVE_STRPTIME_BROKEN OCTAVE_SMART_PUTENV case "$canonical_host_type" in diff -r 144739908eef -r e45ccac6017f liboctave/ChangeLog --- a/liboctave/ChangeLog Mon Feb 01 20:19:54 2010 +0100 +++ b/liboctave/ChangeLog Tue Feb 02 00:51:52 2010 -0500 @@ -1,3 +1,8 @@ +2010-02-02 John W. Eaton + + * lo-utils.h, lo-cutils.c (oct_strptime): Delete. + * oct-time.cc (octave_strptime::init): Call strptime, not oct_strptime. + 2010-01-28 Jaroslav Hajek * dMatrix.cc (Matrix::determinant): Treat matrices marked as singular diff -r 144739908eef -r e45ccac6017f liboctave/lo-cutils.c --- a/liboctave/lo-cutils.c Mon Feb 01 20:19:54 2010 +0100 +++ b/liboctave/lo-cutils.c Tue Feb 02 00:51:52 2010 -0500 @@ -55,12 +55,6 @@ qsort (base, n, size, cmp); } -OCTAVE_API char * -oct_strptime (const char *buf, const char *format, struct tm *tm) -{ - return (char *) strptime (buf, format, tm); -} - #if defined (__WIN32__) && ! defined (_POSIX_VERSION) #include diff -r 144739908eef -r e45ccac6017f liboctave/lo-utils.h --- a/liboctave/lo-utils.h Mon Feb 01 20:19:54 2010 +0100 +++ b/liboctave/lo-utils.h Tue Feb 02 00:51:52 2010 -0500 @@ -56,9 +56,6 @@ octave_qsort (void *base, size_t n, size_t size, int (*cmp) (const void *, const void *)); -extern "C" OCTAVE_API char * -oct_strptime (const char *buf, const char *format, struct tm *tm); - extern "C" OCTAVE_API int octave_strcasecmp (const char *s1, const char *s2); diff -r 144739908eef -r e45ccac6017f liboctave/oct-time.cc --- a/liboctave/oct-time.cc Mon Feb 01 20:19:54 2010 +0100 +++ b/liboctave/oct-time.cc Tue Feb 02 00:51:52 2010 -0500 @@ -272,7 +272,7 @@ char *p = strsave (str.c_str ()); - char *q = oct_strptime (p, fmt.c_str (), &t); + char *q = strptime (p, fmt.c_str (), &t); // Fill in wday and yday, but only if mday is valid and the mon and year // are filled in, avoiding issues with mktime and invalid dates.