summaryrefslogtreecommitdiff
path: root/lib/utime.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2017-04-30 01:26:05 +0200
committerBruno Haible <bruno@clisp.org>2017-04-30 10:30:58 +0200
commit127cc8158810518f7abb27777b649468d91fda8b (patch)
tree6d230fdb0000d6f353e02e7a9833685740aece1e /lib/utime.in.h
parent06464e83f20d6dc0c68d5fe074439a2d1d3e9ebb (diff)
downloadgnulib-127cc8158810518f7abb27777b649468d91fda8b.tar.gz
utime-h: Modernize handling of 'struct utimbuf'.
* lib/utime.in.h: Include next <utime.h> if it exists. (utimbuf): Define to _utimbuf on native Windows. * m4/utime-h.m4 (gl_UTIME_H): Check for prerequisites of include_next. Set UTIME_H on native Windows. (gl_UTIME_MODULE_INDICATOR, gl_HEADER_UTIME_H_DEFAULTS): New macros. * modules/utime-h (Depends-on): Add include_next. (Makefile.am): Substitute also HAVE_UTIME_H, INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER, PRAGMA_COLUMNS, NEXT_UTIME_H. * lib/utimens.c (utimbuf): Remove fallback definition. * m4/utimens.m4 (gl_UTIMENS): Don't require gl_CHECK_TYPE_STRUCT_UTIMBUF. * m4/utimbuf.m4: Remove file. * modules/utimens (Files): Remove m4/utimbuf.m4.
Diffstat (limited to 'lib/utime.in.h')
-rw-r--r--lib/utime.in.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/utime.in.h b/lib/utime.in.h
index 0e3926a3ed..26a1ceaca6 100644
--- a/lib/utime.in.h
+++ b/lib/utime.in.h
@@ -1,4 +1,4 @@
-/* Substitute for <utime.h>
+/* Substitute for and wrapper around <utime.h>.
Copyright (C) 2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -15,8 +15,31 @@
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_UTIME_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_UTIME_H@
+# @INCLUDE_NEXT@ @NEXT_UTIME_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_UTIME_H
#define _@GUARD_PREFIX@_UTIME_H
-#include <sys/utime.h>
+#if !@HAVE_UTIME_H@
+# include <sys/utime.h>
+#endif
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Define 'struct utimbuf' as an alias of 'struct _utimbuf'
+ (or possibly, if present, 'struct __utimbuf64'). */
+# define utimbuf _utimbuf
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_UTIME_H */
#endif /* _@GUARD_PREFIX@_UTIME_H */