New upstream version 1.9
[debian/gzip] / lib / utime.in.h
1 /* Substitute for and wrapper around <utime.h>.
2    Copyright (C) 2017-2018 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 3, or (at your option)
7    any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, see <https://www.gnu.org/licenses/>.  */
16
17 #ifndef _@GUARD_PREFIX@_UTIME_H
18
19 #if __GNUC__ >= 3
20 @PRAGMA_SYSTEM_HEADER@
21 #endif
22 @PRAGMA_COLUMNS@
23
24 /* The include_next requires a split double-inclusion guard.  */
25 #if @HAVE_UTIME_H@
26 # @INCLUDE_NEXT@ @NEXT_UTIME_H@
27 #endif
28
29 #ifndef _@GUARD_PREFIX@_UTIME_H
30 #define _@GUARD_PREFIX@_UTIME_H
31
32 #if !@HAVE_UTIME_H@
33 # include <sys/utime.h>
34 #endif
35
36 #if @GNULIB_UTIME@
37 /* Get struct timespec.  */
38 # include <time.h>
39 #endif
40
41 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
42
43 /* The definition of _GL_ARG_NONNULL is copied here.  */
44
45 /* The definition of _GL_WARN_ON_USE is copied here.  */
46
47
48 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
49
50 /* Define 'struct utimbuf' as an alias of 'struct _utimbuf'
51    (or possibly, if present, 'struct __utimbuf64').  */
52 # define utimbuf _utimbuf
53
54 #endif
55
56
57 #if @GNULIB_UTIME@
58 # if @REPLACE_UTIME@
59 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
60 #   define utime rpl_utime
61 #  endif
62 _GL_FUNCDECL_RPL (utime, int, (const char *filename, const struct utimbuf *ts)
63                               _GL_ARG_NONNULL ((1)));
64 _GL_CXXALIAS_RPL (utime, int, (const char *filename, const struct utimbuf *ts));
65 # else
66 #  if !@HAVE_UTIME@
67 _GL_FUNCDECL_SYS (utime, int, (const char *filename, const struct utimbuf *ts)
68                               _GL_ARG_NONNULL ((1)));
69 #  endif
70 _GL_CXXALIAS_SYS (utime, int, (const char *filename, const struct utimbuf *ts));
71 # endif
72 _GL_CXXALIASWARN (utime);
73 #elif defined GNULIB_POSIXCHECK
74 # undef utime
75 # if HAVE_RAW_DECL_UTIME
76 _GL_WARN_ON_USE (utime,
77                  "utime is unportable - "
78                  "use gnulib module canonicalize-lgpl for portability");
79 # endif
80 #endif
81
82 #if @GNULIB_UTIME@
83 extern int _gl_utimens_windows (const char *filename, struct timespec ts[2]);
84 #endif
85
86
87 #endif /* _@GUARD_PREFIX@_UTIME_H */
88 #endif /* _@GUARD_PREFIX@_UTIME_H */