1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef _@GUARD_PREFIX@_SYS_TIME_H
21
22 #if __GNUC__ >= 3
23 @PRAGMA_SYSTEM_HEADER@
24 #endif
25 @PRAGMA_COLUMNS@
26
27
28
29
30 #if !_GL_CONFIG_H_INCLUDED
31 #error "Please include config.h first."
32 #endif
33
34
35
36
37
38
39 #if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_
40 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
41 #else
42
43
44 #if @HAVE_SYS_TIME_H@
45 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
46 #endif
47
48 #ifndef _@GUARD_PREFIX@_SYS_TIME_H
49 #define _@GUARD_PREFIX@_SYS_TIME_H
50
51
52 #if !_GL_CONFIG_H_INCLUDED
53 #error "Please include config.h first."
54 #endif
55
56 #if ! @HAVE_SYS_TIME_H@
57 # include <time.h>
58 #endif
59
60
61
62
63
64 #if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
65 # define _GL_INCLUDING_WINSOCK2_H
66 # include <winsock2.h>
67 # undef _GL_INCLUDING_WINSOCK2_H
68 #endif
69
70
71
72
73
74
75
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79
80 #if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
81
82 # if @REPLACE_STRUCT_TIMEVAL@
83 # define timeval rpl_timeval
84 # endif
85
86 # if !GNULIB_defined_struct_timeval
87 struct timeval
88 {
89 time_t tv_sec;
90 long int tv_usec;
91 };
92 # define GNULIB_defined_struct_timeval 1
93 # endif
94
95 #endif
96
97 #ifdef __cplusplus
98 }
99 #endif
100
101 #if @GNULIB_GETTIMEOFDAY@
102 # if @REPLACE_GETTIMEOFDAY@
103 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
104 # undef gettimeofday
105 # define gettimeofday rpl_gettimeofday
106 # endif
107 _GL_FUNCDECL_RPL (gettimeofday, int,
108 (struct timeval *restrict, void *restrict)
109 _GL_ARG_NONNULL ((1)));
110 _GL_CXXALIAS_RPL (gettimeofday, int,
111 (struct timeval *restrict, void *restrict));
112 # else
113 # if !@HAVE_GETTIMEOFDAY@
114 _GL_FUNCDECL_SYS (gettimeofday, int,
115 (struct timeval *restrict, void *restrict)
116 _GL_ARG_NONNULL ((1)));
117 # endif
118
119
120 _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
121 (struct timeval *restrict, void *restrict));
122 # endif
123 _GL_CXXALIASWARN (gettimeofday);
124 # if defined __cplusplus && defined GNULIB_NAMESPACE
125 namespace GNULIB_NAMESPACE {
126 typedef ::timeval
127 # undef timeval
128 timeval;
129 # if @REPLACE_STRUCT_TIMEVAL@
130 # define timeval rpl_timeval
131 typedef ::timeval timeval;
132 # endif
133 }
134 # endif
135 #elif defined GNULIB_POSIXCHECK
136 # undef gettimeofday
137 # if HAVE_RAW_DECL_GETTIMEOFDAY
138 _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
139 "use gnulib module gettimeofday for portability");
140 # endif
141 #endif
142
143
144
145 #if defined _MSC_VER && @HAVE_WINSOCK2_H@
146 # if !defined _@GUARD_PREFIX@_UNISTD_H
147 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
148 # undef close
149 # define close close_used_without_including_unistd_h
150 # elif !defined __clang__
151 _GL_WARN_ON_USE (close,
152 "close() used without including <unistd.h>");
153 # endif
154 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
155 # undef gethostname
156 # define gethostname gethostname_used_without_including_unistd_h
157 # else
158 _GL_WARN_ON_USE (gethostname,
159 "gethostname() used without including <unistd.h>");
160 # endif
161 # endif
162 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
163 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
164 # undef socket
165 # define socket socket_used_without_including_sys_socket_h
166 # undef connect
167 # define connect connect_used_without_including_sys_socket_h
168 # undef accept
169 # define accept accept_used_without_including_sys_socket_h
170 # undef bind
171 # define bind bind_used_without_including_sys_socket_h
172 # undef getpeername
173 # define getpeername getpeername_used_without_including_sys_socket_h
174 # undef getsockname
175 # define getsockname getsockname_used_without_including_sys_socket_h
176 # undef getsockopt
177 # define getsockopt getsockopt_used_without_including_sys_socket_h
178 # undef listen
179 # define listen listen_used_without_including_sys_socket_h
180 # undef recv
181 # define recv recv_used_without_including_sys_socket_h
182 # undef send
183 # define send send_used_without_including_sys_socket_h
184 # undef recvfrom
185 # define recvfrom recvfrom_used_without_including_sys_socket_h
186 # undef sendto
187 # define sendto sendto_used_without_including_sys_socket_h
188 # undef setsockopt
189 # define setsockopt setsockopt_used_without_including_sys_socket_h
190 # undef shutdown
191 # define shutdown shutdown_used_without_including_sys_socket_h
192 # else
193 _GL_WARN_ON_USE (socket,
194 "socket() used without including <sys/socket.h>");
195 _GL_WARN_ON_USE (connect,
196 "connect() used without including <sys/socket.h>");
197 _GL_WARN_ON_USE (accept,
198 "accept() used without including <sys/socket.h>");
199 _GL_WARN_ON_USE (bind,
200 "bind() used without including <sys/socket.h>");
201 _GL_WARN_ON_USE (getpeername,
202 "getpeername() used without including <sys/socket.h>");
203 _GL_WARN_ON_USE (getsockname,
204 "getsockname() used without including <sys/socket.h>");
205 _GL_WARN_ON_USE (getsockopt,
206 "getsockopt() used without including <sys/socket.h>");
207 _GL_WARN_ON_USE (listen,
208 "listen() used without including <sys/socket.h>");
209 _GL_WARN_ON_USE (recv,
210 "recv() used without including <sys/socket.h>");
211 _GL_WARN_ON_USE (send,
212 "send() used without including <sys/socket.h>");
213 _GL_WARN_ON_USE (recvfrom,
214 "recvfrom() used without including <sys/socket.h>");
215 _GL_WARN_ON_USE (sendto,
216 "sendto() used without including <sys/socket.h>");
217 _GL_WARN_ON_USE (setsockopt,
218 "setsockopt() used without including <sys/socket.h>");
219 _GL_WARN_ON_USE (shutdown,
220 "shutdown() used without including <sys/socket.h>");
221 # endif
222 # endif
223 # if !defined _@GUARD_PREFIX@_SYS_SELECT_H
224 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
225 # undef select
226 # define select select_used_without_including_sys_select_h
227 # else
228 _GL_WARN_ON_USE (select,
229 "select() used without including <sys/select.h>");
230 # endif
231 # endif
232 #endif
233
234 #endif
235 #endif
236 #endif