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