* m4/utime_h.m4: New file.
* lib/utime.in.h: New file.
* modules/utime-h: New file.
* doc/posix-headers/utime.texi: Mention the new module.
* tests/test-utime-h.c: New file.
* modules/utime-h-tests: New file.
+2017-04-29 Bruno Haible <bruno@clisp.org>
+
+ utime-h: New module.
+ * m4/utime_h.m4: New file.
+ * lib/utime.in.h: New file.
+ * modules/utime-h: New file.
+ * doc/posix-headers/utime.texi: Mention the new module.
+
+ * tests/test-utime-h.c: New file.
+ * modules/utime-h-tests: New file.
+
2017-04-30 Bruno Haible <bruno@clisp.org>
Fix a few typos.
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/utime.h.html}
-Gnulib module: ---
+Gnulib module: utime-h
Portability problems fixed by Gnulib:
@itemize
+@item
+This header file is missing on some platforms: MSVC 14.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This header file is missing on some platforms: MSVC 9. Use @code{<sys/utime.h>}
-if @code{<utime.h>} is missing.
@end itemize
--- /dev/null
+/* Substitute for <utime.h>
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_UTIME_H
+#define _@GUARD_PREFIX@_UTIME_H
+
+#include <sys/utime.h>
+
+#endif /* _@GUARD_PREFIX@_UTIME_H */
--- /dev/null
+# utime_h.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.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_UTIME_H],
+[
+ UTIME_H=''
+ AC_CHECK_HEADERS_ONCE([utime.h])
+ if test $ac_cv_header_utime_h != yes; then
+ dnl Provide a substitute <utime.h> file.
+ UTIME_H=utime.h
+ fi
+ AC_SUBST([UTIME_H])
+ AM_CONDITIONAL([GL_GENERATE_UTIME_H], [test -n "$UTIME_H"])
+])
--- /dev/null
+Description:
+A <utime.h> that conforms to POSIX.
+
+Files:
+lib/utime.in.h
+m4/utime_h.m4
+
+Depends-on:
+
+configure.ac:
+gl_UTIME_H
+
+Makefile.am:
+BUILT_SOURCES += $(UTIME_H)
+
+# We need the following in order to create <utime.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_UTIME_H
+utime.h: utime.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
+ < $(srcdir)/utime.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+utime.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += utime.h utime.h-t
+
+Include:
+<utime.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
--- /dev/null
+Files:
+tests/test-utime-h.c
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-utime-h
+check_PROGRAMS += test-utime-h
--- /dev/null
+/* Test of <utime.h> substitute.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2017. */
+
+#include <config.h>
+
+#include <utime.h>
+
+/* Check that 'struct utimbuf' is defined. */
+struct utimbuf b;
+
+int
+main (void)
+{
+ b.actime = b.modtime = 1493490248; /* 2017-04-29 18:24:08 GMT */
+
+ return 0;
+}