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-2013 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, <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@
37 /* The include_next requires a split double-inclusion guard. */
39 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
42 #ifndef _@GUARD_PREFIX@_SYS_TIME_H
43 #define _@GUARD_PREFIX@_SYS_TIME_H
45 #if ! @HAVE_SYS_TIME_H@
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
59 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
61 /* The definition of _GL_ARG_NONNULL is copied here. */
63 /* The definition of _GL_WARN_ON_USE is copied here. */
69 #if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
71 # if @REPLACE_STRUCT_TIMEVAL@
72 # define timeval rpl_timeval
75 # if !GNULIB_defined_struct_timeval
81 # define GNULIB_defined_struct_timeval 1
90 #if @GNULIB_GETTIMEOFDAY@
91 # if @REPLACE_GETTIMEOFDAY@
92 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
94 # define gettimeofday rpl_gettimeofday
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));
102 # if !@HAVE_GETTIMEOFDAY@
103 _GL_FUNCDECL_SYS (gettimeofday, int,
104 (struct timeval *restrict, void *restrict)
105 _GL_ARG_NONNULL ((1)));
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));
112 _GL_CXXALIASWARN (gettimeofday);
113 #elif defined GNULIB_POSIXCHECK
115 # if HAVE_RAW_DECL_GETTIMEOFDAY
116 _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
117 "use gnulib module gettimeofday for portability");
121 /* Hide some function declarations from <winsock2.h>. */
123 #if defined _MSC_VER && @HAVE_WINSOCK2_H@
124 # if !defined _@GUARD_PREFIX@_UNISTD_H
125 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
127 # define close close_used_without_including_unistd_h
129 _GL_WARN_ON_USE (close,
130 "close() used without including <unistd.h>");
132 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
134 # define gethostname gethostname_used_without_including_unistd_h
136 _GL_WARN_ON_USE (gethostname,
137 "gethostname() used without including <unistd.h>");
140 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
141 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
143 # define socket socket_used_without_including_sys_socket_h
145 # define connect connect_used_without_including_sys_socket_h
147 # define accept accept_used_without_including_sys_socket_h
149 # define bind bind_used_without_including_sys_socket_h
151 # define getpeername getpeername_used_without_including_sys_socket_h
153 # define getsockname getsockname_used_without_including_sys_socket_h
155 # define getsockopt getsockopt_used_without_including_sys_socket_h
157 # define listen listen_used_without_including_sys_socket_h
159 # define recv recv_used_without_including_sys_socket_h
161 # define send send_used_without_including_sys_socket_h
163 # define recvfrom recvfrom_used_without_including_sys_socket_h
165 # define sendto sendto_used_without_including_sys_socket_h
167 # define setsockopt setsockopt_used_without_including_sys_socket_h
169 # define shutdown shutdown_used_without_including_sys_socket_h
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>");
201 # if !defined _@GUARD_PREFIX@_SYS_SELECT_H
202 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
204 # define select select_used_without_including_sys_select_h
206 _GL_WARN_ON_USE (select,
207 "select() used without including <sys/select.h>");
212 #endif /* _@GUARD_PREFIX@_SYS_TIME_H */
213 #endif /* _CYGWIN_SYS_TIME_H */
214 #endif /* _@GUARD_PREFIX@_SYS_TIME_H */