| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#if __GNUC__ >= 3 |
| 19 |
@PRAGMA_SYSTEM_HEADER@ |
| 20 |
#endif |
| 21 |
@PRAGMA_COLUMNS@ |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#if (((defined __need_time_t || defined __need_clock_t \ |
| 30 |
|| defined __need_timespec) \ |
| 31 |
&& !defined __MINGW32__) \ |
| 32 |
|| defined _@GUARD_PREFIX@_TIME_H) |
| 33 |
|
| 34 |
# @INCLUDE_NEXT@ @NEXT_TIME_H@ |
| 35 |
|
| 36 |
#else |
| 37 |
|
| 38 |
# define _@GUARD_PREFIX@_TIME_H |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
# if defined __MINGW32__ |
| 43 |
# include <unistd.h> |
| 44 |
# endif |
| 45 |
|
| 46 |
# @INCLUDE_NEXT@ @NEXT_TIME_H@ |
| 47 |
|
| 48 |
|
| 49 |
# include <stddef.h> |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@ |
| 62 |
# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ |
| 63 |
# include <sys/time.h> |
| 64 |
# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ |
| 65 |
# include <pthread.h> |
| 66 |
# elif @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ |
| 67 |
# include <unistd.h> |
| 68 |
# else |
| 69 |
|
| 70 |
# ifdef __cplusplus |
| 71 |
extern "C" { |
| 72 |
# endif |
| 73 |
|
| 74 |
# if !GNULIB_defined_struct_timespec |
| 75 |
# undef timespec |
| 76 |
# define timespec rpl_timespec |
| 77 |
struct timespec |
| 78 |
{ |
| 79 |
time_t tv_sec; |
| 80 |
long int tv_nsec; |
| 81 |
}; |
| 82 |
# define GNULIB_defined_struct_timespec 1 |
| 83 |
# endif |
| 84 |
|
| 85 |
# ifdef __cplusplus |
| 86 |
} |
| 87 |
# endif |
| 88 |
|
| 89 |
# endif |
| 90 |
# endif |
| 91 |
|
| 92 |
# if !GNULIB_defined_struct_time_t_must_be_integral |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
struct __time_t_must_be_integral { |
| 99 |
unsigned int __floating_time_t_unsupported : (time_t) 1; |
| 100 |
}; |
| 101 |
# define GNULIB_defined_struct_time_t_must_be_integral 1 |
| 102 |
# endif |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
# if @GNULIB_NANOSLEEP@ |
| 108 |
# if @REPLACE_NANOSLEEP@ |
| 109 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 110 |
# define nanosleep rpl_nanosleep |
| 111 |
# endif |
| 112 |
_GL_FUNCDECL_RPL (nanosleep, int, |
| 113 |
(struct timespec const *__rqtp, struct timespec *__rmtp) |
| 114 |
_GL_ARG_NONNULL ((1))); |
| 115 |
_GL_CXXALIAS_RPL (nanosleep, int, |
| 116 |
(struct timespec const *__rqtp, struct timespec *__rmtp)); |
| 117 |
# else |
| 118 |
# if ! @HAVE_NANOSLEEP@ |
| 119 |
_GL_FUNCDECL_SYS (nanosleep, int, |
| 120 |
(struct timespec const *__rqtp, struct timespec *__rmtp) |
| 121 |
_GL_ARG_NONNULL ((1))); |
| 122 |
# endif |
| 123 |
_GL_CXXALIAS_SYS (nanosleep, int, |
| 124 |
(struct timespec const *__rqtp, struct timespec *__rmtp)); |
| 125 |
# endif |
| 126 |
_GL_CXXALIASWARN (nanosleep); |
| 127 |
# endif |
| 128 |
|
| 129 |
|
| 130 |
# if @GNULIB_TZSET@ |
| 131 |
# if @REPLACE_TZSET@ |
| 132 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 133 |
# undef tzset |
| 134 |
# define tzset rpl_tzset |
| 135 |
# endif |
| 136 |
_GL_FUNCDECL_RPL (tzset, void, (void)); |
| 137 |
_GL_CXXALIAS_RPL (tzset, void, (void)); |
| 138 |
# else |
| 139 |
# if ! @HAVE_TZSET@ |
| 140 |
_GL_FUNCDECL_SYS (tzset, void, (void)); |
| 141 |
# endif |
| 142 |
_GL_CXXALIAS_SYS (tzset, void, (void)); |
| 143 |
# endif |
| 144 |
_GL_CXXALIASWARN (tzset); |
| 145 |
# endif |
| 146 |
|
| 147 |
|
| 148 |
# if @GNULIB_MKTIME@ |
| 149 |
# if @REPLACE_MKTIME@ |
| 150 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 151 |
# define mktime rpl_mktime |
| 152 |
# endif |
| 153 |
_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); |
| 154 |
_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); |
| 155 |
# else |
| 156 |
_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); |
| 157 |
# endif |
| 158 |
# if __GLIBC__ >= 2 |
| 159 |
_GL_CXXALIASWARN (mktime); |
| 160 |
# endif |
| 161 |
# endif |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
# if @GNULIB_TIME_R@ |
| 167 |
# if @REPLACE_LOCALTIME_R@ |
| 168 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 169 |
# undef localtime_r |
| 170 |
# define localtime_r rpl_localtime_r |
| 171 |
# endif |
| 172 |
_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 173 |
struct tm *restrict __result) |
| 174 |
_GL_ARG_NONNULL ((1, 2))); |
| 175 |
_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 176 |
struct tm *restrict __result)); |
| 177 |
# else |
| 178 |
# if ! @HAVE_DECL_LOCALTIME_R@ |
| 179 |
_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 180 |
struct tm *restrict __result) |
| 181 |
_GL_ARG_NONNULL ((1, 2))); |
| 182 |
# endif |
| 183 |
_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 184 |
struct tm *restrict __result)); |
| 185 |
# endif |
| 186 |
# if @HAVE_DECL_LOCALTIME_R@ |
| 187 |
_GL_CXXALIASWARN (localtime_r); |
| 188 |
# endif |
| 189 |
# if @REPLACE_LOCALTIME_R@ |
| 190 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 191 |
# undef gmtime_r |
| 192 |
# define gmtime_r rpl_gmtime_r |
| 193 |
# endif |
| 194 |
_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 195 |
struct tm *restrict __result) |
| 196 |
_GL_ARG_NONNULL ((1, 2))); |
| 197 |
_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 198 |
struct tm *restrict __result)); |
| 199 |
# else |
| 200 |
# if ! @HAVE_DECL_LOCALTIME_R@ |
| 201 |
_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 202 |
struct tm *restrict __result) |
| 203 |
_GL_ARG_NONNULL ((1, 2))); |
| 204 |
# endif |
| 205 |
_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 206 |
struct tm *restrict __result)); |
| 207 |
# endif |
| 208 |
# if @HAVE_DECL_LOCALTIME_R@ |
| 209 |
_GL_CXXALIASWARN (gmtime_r); |
| 210 |
# endif |
| 211 |
# endif |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
# if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@ |
| 217 |
# if @REPLACE_LOCALTIME@ |
| 218 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 219 |
# undef localtime |
| 220 |
# define localtime rpl_localtime |
| 221 |
# endif |
| 222 |
_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) |
| 223 |
_GL_ARG_NONNULL ((1))); |
| 224 |
_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); |
| 225 |
# else |
| 226 |
_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); |
| 227 |
# endif |
| 228 |
# if __GLIBC__ >= 2 |
| 229 |
_GL_CXXALIASWARN (localtime); |
| 230 |
# endif |
| 231 |
# endif |
| 232 |
|
| 233 |
# if 0 || @REPLACE_GMTIME@ |
| 234 |
# if @REPLACE_GMTIME@ |
| 235 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 236 |
# undef gmtime |
| 237 |
# define gmtime rpl_gmtime |
| 238 |
# endif |
| 239 |
_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) |
| 240 |
_GL_ARG_NONNULL ((1))); |
| 241 |
_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); |
| 242 |
# else |
| 243 |
_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer)); |
| 244 |
# endif |
| 245 |
_GL_CXXALIASWARN (gmtime); |
| 246 |
# endif |
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
# if @GNULIB_STRPTIME@ |
| 252 |
# if ! @HAVE_STRPTIME@ |
| 253 |
_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, |
| 254 |
char const *restrict __format, |
| 255 |
struct tm *restrict __tm) |
| 256 |
_GL_ARG_NONNULL ((1, 2, 3))); |
| 257 |
# endif |
| 258 |
_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, |
| 259 |
char const *restrict __format, |
| 260 |
struct tm *restrict __tm)); |
| 261 |
_GL_CXXALIASWARN (strptime); |
| 262 |
# endif |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
# if @GNULIB_CTIME@ |
| 267 |
# if @REPLACE_CTIME@ |
| 268 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 269 |
# define ctime rpl_ctime |
| 270 |
# endif |
| 271 |
_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp) |
| 272 |
_GL_ARG_NONNULL ((1))); |
| 273 |
_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp)); |
| 274 |
# else |
| 275 |
_GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp)); |
| 276 |
# endif |
| 277 |
# if __GLIBC__ >= 2 |
| 278 |
_GL_CXXALIASWARN (ctime); |
| 279 |
# endif |
| 280 |
# endif |
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
# if @GNULIB_STRFTIME@ |
| 285 |
# if @REPLACE_STRFTIME@ |
| 286 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 287 |
# define strftime rpl_strftime |
| 288 |
# endif |
| 289 |
_GL_FUNCDECL_RPL (strftime, size_t, |
| 290 |
(char *restrict __buf, size_t __bufsize, |
| 291 |
const char *restrict __fmt, const struct tm *restrict __tp) |
| 292 |
_GL_ARG_NONNULL ((1, 3, 4))); |
| 293 |
_GL_CXXALIAS_RPL (strftime, size_t, |
| 294 |
(char *restrict __buf, size_t __bufsize, |
| 295 |
const char *restrict __fmt, const struct tm *restrict __tp)); |
| 296 |
# else |
| 297 |
_GL_CXXALIAS_SYS (strftime, size_t, |
| 298 |
(char *restrict __buf, size_t __bufsize, |
| 299 |
const char *restrict __fmt, const struct tm *restrict __tp)); |
| 300 |
# endif |
| 301 |
# if __GLIBC__ >= 2 |
| 302 |
_GL_CXXALIASWARN (strftime); |
| 303 |
# endif |
| 304 |
# endif |
| 305 |
|
| 306 |
# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@ |
| 307 |
typedef struct tm_zone *timezone_t; |
| 308 |
_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name)); |
| 309 |
_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); |
| 310 |
_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz)); |
| 311 |
_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); |
| 312 |
_GL_FUNCDECL_SYS (localtime_rz, struct tm *, |
| 313 |
(timezone_t __tz, time_t const *restrict __timer, |
| 314 |
struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3))); |
| 315 |
_GL_CXXALIAS_SYS (localtime_rz, struct tm *, |
| 316 |
(timezone_t __tz, time_t const *restrict __timer, |
| 317 |
struct tm *restrict __result)); |
| 318 |
_GL_FUNCDECL_SYS (mktime_z, time_t, |
| 319 |
(timezone_t __tz, struct tm *restrict __result) |
| 320 |
_GL_ARG_NONNULL ((2))); |
| 321 |
_GL_CXXALIAS_SYS (mktime_z, time_t, |
| 322 |
(timezone_t __tz, struct tm *restrict __result)); |
| 323 |
# endif |
| 324 |
|
| 325 |
|
| 326 |
# if @GNULIB_TIMEGM@ |
| 327 |
# if @REPLACE_TIMEGM@ |
| 328 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 329 |
# undef timegm |
| 330 |
# define timegm rpl_timegm |
| 331 |
# endif |
| 332 |
_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); |
| 333 |
_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); |
| 334 |
# else |
| 335 |
# if ! @HAVE_TIMEGM@ |
| 336 |
_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); |
| 337 |
# endif |
| 338 |
_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); |
| 339 |
# endif |
| 340 |
_GL_CXXALIASWARN (timegm); |
| 341 |
# endif |
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
# if defined GNULIB_POSIXCHECK |
| 347 |
# undef asctime |
| 348 |
_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " |
| 349 |
"better use strftime (or even sprintf) instead"); |
| 350 |
# endif |
| 351 |
# if defined GNULIB_POSIXCHECK |
| 352 |
# undef asctime_r |
| 353 |
_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " |
| 354 |
"better use strftime (or even sprintf) instead"); |
| 355 |
# endif |
| 356 |
# if defined GNULIB_POSIXCHECK |
| 357 |
# undef ctime |
| 358 |
_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " |
| 359 |
"better use strftime (or even sprintf) instead"); |
| 360 |
# endif |
| 361 |
# if defined GNULIB_POSIXCHECK |
| 362 |
# undef ctime_r |
| 363 |
_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " |
| 364 |
"better use strftime (or even sprintf) instead"); |
| 365 |
# endif |
| 366 |
|
| 367 |
#endif |