6b51c02953d4339a775973595ab50ca0e5c3dd64
[debian/tar] / gnu / sys_time.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Provide a more complete sys/time.h.
4
5    Copyright (C) 2007-2013 Free Software Foundation, Inc.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, see <http://www.gnu.org/licenses/>.  */
19
20 /* Written by Paul Eggert.  */
21
22 #ifndef _@GUARD_PREFIX@_SYS_TIME_H
23
24 #if __GNUC__ >= 3
25 @PRAGMA_SYSTEM_HEADER@
26 #endif
27 @PRAGMA_COLUMNS@
28
29 /* On Cygwin, <sys/time.h> includes itself recursively via <sys/select.h>.
30    Simply delegate to the system's header in this case; it is a no-op.
31    Without this extra ifdef, the C++ gettimeofday declaration below
32    would be a forward declaration in gnulib's nested <sys/time.h>.  */
33 #ifdef _CYGWIN_SYS_TIME_H
34 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
35 #else
36
37 /* The include_next requires a split double-inclusion guard.  */
38 #if @HAVE_SYS_TIME_H@
39 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
40 #endif
41
42 #ifndef _@GUARD_PREFIX@_SYS_TIME_H
43 #define _@GUARD_PREFIX@_SYS_TIME_H
44
45 #if ! @HAVE_SYS_TIME_H@
46 # include <time.h>
47 #endif
48
49 /* On native Windows with MSVC, get the 'struct timeval' type.
50    Also, on native Windows with a 64-bit time_t, where we are overriding the
51    'struct timeval' type, get all declarations of system functions whose
52    signature contains 'struct timeval'.  */
53 #if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
54 # define _GL_INCLUDING_WINSOCK2_H
55 # include <winsock2.h>
56 # undef _GL_INCLUDING_WINSOCK2_H
57 #endif
58
59 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
60
61 /* The definition of _GL_ARG_NONNULL is copied here.  */
62
63 /* The definition of _GL_WARN_ON_USE is copied here.  */
64
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68
69 #if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
70
71 # if @REPLACE_STRUCT_TIMEVAL@
72 #  define timeval rpl_timeval
73 # endif
74
75 # if !GNULIB_defined_struct_timeval
76 struct timeval
77 {
78   time_t tv_sec;
79   long int tv_usec;
80 };
81 #  define GNULIB_defined_struct_timeval 1
82 # endif
83
84 #endif
85
86 #ifdef __cplusplus
87 }
88 #endif
89
90 #if @GNULIB_GETTIMEOFDAY@
91 # if @REPLACE_GETTIMEOFDAY@
92 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
93 #   undef gettimeofday
94 #   define gettimeofday rpl_gettimeofday
95 #  endif
96 _GL_FUNCDECL_RPL (gettimeofday, int,
97                   (struct timeval *restrict, void *restrict)
98                   _GL_ARG_NONNULL ((1)));
99 _GL_CXXALIAS_RPL (gettimeofday, int,
100                   (struct timeval *restrict, void *restrict));
101 # else
102 #  if !@HAVE_GETTIMEOFDAY@
103 _GL_FUNCDECL_SYS (gettimeofday, int,
104                   (struct timeval *restrict, void *restrict)
105                   _GL_ARG_NONNULL ((1)));
106 #  endif
107 /* Need to cast, because on glibc systems, by default, the second argument is
108                                                   struct timezone *.  */
109 _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
110                        (struct timeval *restrict, void *restrict));
111 # endif
112 _GL_CXXALIASWARN (gettimeofday);
113 #elif defined GNULIB_POSIXCHECK
114 # undef gettimeofday
115 # if HAVE_RAW_DECL_GETTIMEOFDAY
116 _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
117                  "use gnulib module gettimeofday for portability");
118 # endif
119 #endif
120
121 /* Hide some function declarations from <winsock2.h>.  */
122
123 #if defined _MSC_VER && @HAVE_WINSOCK2_H@
124 # if !defined _@GUARD_PREFIX@_UNISTD_H
125 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
126 #   undef close
127 #   define close close_used_without_including_unistd_h
128 #  else
129      _GL_WARN_ON_USE (close,
130                       "close() used without including <unistd.h>");
131 #  endif
132 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
133 #   undef gethostname
134 #   define gethostname gethostname_used_without_including_unistd_h
135 #  else
136      _GL_WARN_ON_USE (gethostname,
137                       "gethostname() used without including <unistd.h>");
138 #  endif
139 # endif
140 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
141 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
142 #   undef socket
143 #   define socket              socket_used_without_including_sys_socket_h
144 #   undef connect
145 #   define connect             connect_used_without_including_sys_socket_h
146 #   undef accept
147 #   define accept              accept_used_without_including_sys_socket_h
148 #   undef bind
149 #   define bind                bind_used_without_including_sys_socket_h
150 #   undef getpeername
151 #   define getpeername         getpeername_used_without_including_sys_socket_h
152 #   undef getsockname
153 #   define getsockname         getsockname_used_without_including_sys_socket_h
154 #   undef getsockopt
155 #   define getsockopt          getsockopt_used_without_including_sys_socket_h
156 #   undef listen
157 #   define listen              listen_used_without_including_sys_socket_h
158 #   undef recv
159 #   define recv                recv_used_without_including_sys_socket_h
160 #   undef send
161 #   define send                send_used_without_including_sys_socket_h
162 #   undef recvfrom
163 #   define recvfrom            recvfrom_used_without_including_sys_socket_h
164 #   undef sendto
165 #   define sendto              sendto_used_without_including_sys_socket_h
166 #   undef setsockopt
167 #   define setsockopt          setsockopt_used_without_including_sys_socket_h
168 #   undef shutdown
169 #   define shutdown            shutdown_used_without_including_sys_socket_h
170 #  else
171      _GL_WARN_ON_USE (socket,
172                       "socket() used without including <sys/socket.h>");
173      _GL_WARN_ON_USE (connect,
174                       "connect() used without including <sys/socket.h>");
175      _GL_WARN_ON_USE (accept,
176                       "accept() used without including <sys/socket.h>");
177      _GL_WARN_ON_USE (bind,
178                       "bind() used without including <sys/socket.h>");
179      _GL_WARN_ON_USE (getpeername,
180                       "getpeername() used without including <sys/socket.h>");
181      _GL_WARN_ON_USE (getsockname,
182                       "getsockname() used without including <sys/socket.h>");
183      _GL_WARN_ON_USE (getsockopt,
184                       "getsockopt() used without including <sys/socket.h>");
185      _GL_WARN_ON_USE (listen,
186                       "listen() used without including <sys/socket.h>");
187      _GL_WARN_ON_USE (recv,
188                       "recv() used without including <sys/socket.h>");
189      _GL_WARN_ON_USE (send,
190                       "send() used without including <sys/socket.h>");
191      _GL_WARN_ON_USE (recvfrom,
192                       "recvfrom() used without including <sys/socket.h>");
193      _GL_WARN_ON_USE (sendto,
194                       "sendto() used without including <sys/socket.h>");
195      _GL_WARN_ON_USE (setsockopt,
196                       "setsockopt() used without including <sys/socket.h>");
197      _GL_WARN_ON_USE (shutdown,
198                       "shutdown() used without including <sys/socket.h>");
199 #  endif
200 # endif
201 # if !defined _@GUARD_PREFIX@_SYS_SELECT_H
202 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
203 #   undef select
204 #   define select select_used_without_including_sys_select_h
205 #  else
206      _GL_WARN_ON_USE (select,
207                       "select() used without including <sys/select.h>");
208 #  endif
209 # endif
210 #endif
211
212 #endif /* _@GUARD_PREFIX@_SYS_TIME_H */
213 #endif /* _CYGWIN_SYS_TIME_H */
214 #endif /* _@GUARD_PREFIX@_SYS_TIME_H */