Mercurial > hg > octave-nkf > gnulib-hg
changeset 14796:5fcbe73883bf
New module 'mktime-internal'.
* modules/mktime-internal: New file.
* m4/timegm.m4 (gl_PREREQ_TIMEGM): Move contents to ...
* m4/mktime.m4 (gl_FUNC_MKTIME_INTERNAL): New macro. Define
mktime_internal as a C macro if libc has __mktime_internal.
* modules/timegm (Depends-on): Add mktime-internal. Remove mktime. Add
conditions.
* MODULES.html.sh (Date and time <time.h>): Add mktime-internal.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 22 May 2011 16:39:23 +0200 |
parents | d62488163e76 |
children | 70abceb5dff3 |
files | ChangeLog MODULES.html.sh m4/mktime.m4 m4/timegm.m4 modules/mktime-internal modules/timegm |
diffstat | 6 files changed, 56 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-05-22 Bruno Haible <bruno@clisp.org> + + New module 'mktime-internal'. + * modules/mktime-internal: New file. + * m4/timegm.m4 (gl_PREREQ_TIMEGM): Move contents to ... + * m4/mktime.m4 (gl_FUNC_MKTIME_INTERNAL): New macro. Define + mktime_internal as a C macro if libc has __mktime_internal. + * modules/timegm (Depends-on): Add mktime-internal. Remove mktime. Add + conditions. + * MODULES.html.sh (Date and time <time.h>): Add mktime-internal. + 2011-05-22 Bruno Haible <bruno@clisp.org> timegm: Correct mktime replacement statements.
--- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -1834,6 +1834,7 @@ func_echo "$element" func_begin_table + func_module mktime-internal func_module parse-datetime func_module timegm func_module tzset
--- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,4 +1,4 @@ -# serial 19 +# serial 20 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -234,6 +234,23 @@ fi ]) +AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [ + AC_REQUIRE([gl_FUNC_MKTIME]) + if test $REPLACE_MKTIME = 0; then + dnl BeOS has __mktime_internal in libc, but other platforms don't. + AC_CHECK_FUNC([__mktime_internal], + [AC_DEFINE([mktime_internal], [__mktime_internal], + [Define to the real name of the mktime_internal function.]) + ], + [dnl mktime works but it doesn't export __mktime_internal, + dnl so we need to substitute our own mktime implementation. + REPLACE_MKTIME=1 + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + ]) + fi +]) + # Prerequisites of lib/mktime.c. AC_DEFUN([gl_PREREQ_MKTIME], [
--- a/m4/timegm.m4 +++ b/m4/timegm.m4 @@ -26,13 +26,5 @@ # Prerequisites of lib/timegm.c. AC_DEFUN([gl_PREREQ_TIMEGM], [ - AC_REQUIRE([gl_FUNC_MKTIME]) - if test $ac_cv_func_working_mktime = yes; then - AC_CHECK_FUNC([__mktime_internal], , - [# mktime works but it doesn't export __mktime_internal, - # so we need to substitute our own mktime implementation. - AC_LIBOBJ([mktime]) - REPLACE_MKTIME=1 - gl_PREREQ_MKTIME]) - fi + : ])
new file mode 100644 --- /dev/null +++ b/modules/mktime-internal @@ -0,0 +1,23 @@ +Description: +mktime_internal() function: convert broken-down time to linear time. + +Files: +lib/mktime-internal.h +lib/mktime.c + +Depends-on: +mktime + +configure.ac: +gl_FUNC_MKTIME_INTERNAL + +Makefile.am: + +Include: +"mktime-internal.h" + +License: +LGPLv2+ + +Maintainer: +Bruno Haible, Paul Eggert