diff options
author | Bruno Haible <bruno@clisp.org> | 2017-04-30 13:19:24 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2017-04-30 19:26:37 +0200 |
commit | 8c59a9eb5cdd49322c399601bcbee630321164de (patch) | |
tree | a141f630dd8187f48280ddf9eb76b6e20e6c88df /m4 | |
parent | 8625e57a6e10f41b50d6912d1f9205533bae16b6 (diff) | |
download | gnulib-8c59a9eb5cdd49322c399601bcbee630321164de.tar.gz |
ctime: New module.
* lib/time.in.h (ctime): New declaration.
* lib/ctime.c: New file.
* m4/ctime.m4: New file.
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_CTIME,
REPLACE_CTIME.
* modules/time (Makefile.am): Substitute GNULIB_CTIME, REPLACE_CTIME.
* modules/ctime: New file.
* doc/posix-functions/ctime.texi: Mention the new module.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ctime.m4 | 15 | ||||
-rw-r--r-- | m4/time_h.m4 | 4 |
2 files changed, 18 insertions, 1 deletions
diff --git a/m4/ctime.m4 b/m4/ctime.m4 new file mode 100644 index 0000000000..2d4b3f82ed --- /dev/null +++ b/m4/ctime.m4 @@ -0,0 +1,15 @@ +# ctime.m4 serial 1 +dnl Copyright (C) 2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_CTIME], +[ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) REPLACE_CTIME=1 ;; + *) REPLACE_CTIME=0 ;; + esac +]) diff --git a/m4/time_h.m4 b/m4/time_h.m4 index b92567875c..fdd819bc59 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -2,7 +2,7 @@ # Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. -# serial 9 +# serial 10 # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -104,6 +104,7 @@ AC_DEFUN([gl_TIME_MODULE_INDICATOR], AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], [ + GNULIB_CTIME=0; AC_SUBST([GNULIB_CTIME]) GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) @@ -118,6 +119,7 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], dnl If another module says to replace or to not replace, do that. dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; dnl this lets maintainers check for portability. + REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME]) REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) |