1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Provide a more complete sys/time.h.
5 Copyright (C) 2007-2014 Free Software Foundation, Inc.
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)
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.
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/>. */
20 /* Written by Paul Eggert. */
22 #ifndef _@GUARD_PREFIX@_SYS_TIME_H
25 @PRAGMA_SYSTEM_HEADER@
29 /* On Cygwin and on many BSDish systems, <sys/time.h> includes itself
30 recursively via <sys/select.h>.
31 Simply delegate to the system's header in this case; it is a no-op.
32 Without this extra ifdef, the C++ gettimeofday declaration below
33 would be a forward declaration in gnulib's nested <sys/time.h>. */
34 #if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_
35 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
38 /* The include_next requires a split double-inclusion guard. */
40 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
43 #ifndef _@GUARD_PREFIX@_SYS_TIME_H
44 #define _@GUARD_PREFIX@_SYS_TIME_H
46 #if ! @HAVE_SYS_TIME_H@
50 /* On native Windows with MSVC, get the 'struct timeval' type.
51 Also, on native Windows with a 64-bit time_t, where we are overriding the
52 'struct timeval' type, get all declarations of system functions whose
53 signature contains 'struct timeval'. */
54 #if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
55 # define _GL_INCLUDING_WINSOCK2_H
56 # include <winsock2.h>
57 # undef _GL_INCLUDING_WINSOCK2_H
60 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
62 /* The definition of _GL_ARG_NONNULL is copied here. */
64 /* The definition of _GL_WARN_ON_USE is copied here. */
70 #if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
72 # if @REPLACE_STRUCT_TIMEVAL@
73 # define timeval rpl_timeval
76 # if !GNULIB_defined_struct_timeval
82 # define GNULIB_defined_struct_timeval 1
91 #if @GNULIB_GETTIMEOFDAY@
92 # if @REPLACE_GETTIMEOFDAY@
93 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
95 # define gettimeofday rpl_gettimeofday
97 _GL_FUNCDECL_RPL (gettimeofday, int,
98 (struct timeval *restrict, void *restrict)
99 _GL_ARG_NONNULL ((1)));
100 _GL_CXXALIAS_RPL (gettimeofday, int,
101 (struct timeval *restrict, void *restrict));
103 # if !@HAVE_GETTIMEOFDAY@
104 _GL_FUNCDECL_SYS (gettimeofday, int,
105 (struct timeval *restrict, void *restrict)
106 _GL_ARG_NONNULL ((1)));
108 /* Need to cast, because on glibc systems, by default, the second argument is
109 struct timezone *. */
110 _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
111 (struct timeval *restrict, void *restrict));
113 _GL_CXXALIASWARN (gettimeofday);
114 #elif defined GNULIB_POSIXCHECK
116 # if HAVE_RAW_DECL_GETTIMEOFDAY
117 _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
118 "use gnulib module gettimeofday for portability");
122 /* Hide some function declarations from <winsock2.h>. */
124 #if defined _MSC_VER && @HAVE_WINSOCK2_H@
125 # if !defined _@GUARD_PREFIX@_UNISTD_H
126 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
128 # define close close_used_without_including_unistd_h
130 _GL_WARN_ON_USE (close,
131 "close() used without including <unistd.h>");
133 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
135 # define gethostname gethostname_used_without_including_unistd_h
137 _GL_WARN_ON_USE (gethostname,
138 "gethostname() used without including <unistd.h>");
141 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
142 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
144 # define socket socket_used_without_including_sys_socket_h
146 # define connect connect_used_without_including_sys_socket_h
148 # define accept accept_used_without_including_sys_socket_h
150 # define bind bind_used_without_including_sys_socket_h
152 # define getpeername getpeername_used_without_including_sys_socket_h
154 # define getsockname getsockname_used_without_including_sys_socket_h
156 # define getsockopt getsockopt_used_without_including_sys_socket_h
158 # define listen listen_used_without_including_sys_socket_h
160 # define recv recv_used_without_including_sys_socket_h
162 # define send send_used_without_including_sys_socket_h
164 # define recvfrom recvfrom_used_without_including_sys_socket_h
166 # define sendto sendto_used_without_including_sys_socket_h
168 # define setsockopt setsockopt_used_without_including_sys_socket_h
170 # define shutdown shutdown_used_without_including_sys_socket_h
172 _GL_WARN_ON_USE (socket,
173 "socket() used without including <sys/socket.h>");
174 _GL_WARN_ON_USE (connect,
175 "connect() used without including <sys/socket.h>");
176 _GL_WARN_ON_USE (accept,
177 "accept() used without including <sys/socket.h>");
178 _GL_WARN_ON_USE (bind,
179 "bind() used without including <sys/socket.h>");
180 _GL_WARN_ON_USE (getpeername,
181 "getpeername() used without including <sys/socket.h>");
182 _GL_WARN_ON_USE (getsockname,
183 "getsockname() used without including <sys/socket.h>");
184 _GL_WARN_ON_USE (getsockopt,
185 "getsockopt() used without including <sys/socket.h>");
186 _GL_WARN_ON_USE (listen,
187 "listen() used without including <sys/socket.h>");
188 _GL_WARN_ON_USE (recv,
189 "recv() used without including <sys/socket.h>");
190 _GL_WARN_ON_USE (send,
191 "send() used without including <sys/socket.h>");
192 _GL_WARN_ON_USE (recvfrom,
193 "recvfrom() used without including <sys/socket.h>");
194 _GL_WARN_ON_USE (sendto,
195 "sendto() used without including <sys/socket.h>");
196 _GL_WARN_ON_USE (setsockopt,
197 "setsockopt() used without including <sys/socket.h>");
198 _GL_WARN_ON_USE (shutdown,
199 "shutdown() used without including <sys/socket.h>");
202 # if !defined _@GUARD_PREFIX@_SYS_SELECT_H
203 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
205 # define select select_used_without_including_sys_select_h
207 _GL_WARN_ON_USE (select,
208 "select() used without including <sys/select.h>");
213 #endif /* _@GUARD_PREFIX@_SYS_TIME_H */
214 #endif /* _CYGWIN_SYS_TIME_H */
215 #endif /* _@GUARD_PREFIX@_SYS_TIME_H */