| 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 |
#if (defined __need_time_t || defined __need_clock_t \ |
| 29 |
|| defined __need_timespec \ |
| 30 |
|| defined _@GUARD_PREFIX@_TIME_H) |
| 31 |
|
| 32 |
# @INCLUDE_NEXT@ @NEXT_TIME_H@ |
| 33 |
|
| 34 |
#else |
| 35 |
|
| 36 |
# define _@GUARD_PREFIX@_TIME_H |
| 37 |
|
| 38 |
# @INCLUDE_NEXT@ @NEXT_TIME_H@ |
| 39 |
|
| 40 |
|
| 41 |
# include <stddef.h> |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@ |
| 54 |
# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ |
| 55 |
# include <sys/time.h> |
| 56 |
# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ |
| 57 |
# include <pthread.h> |
| 58 |
|
| 59 |
# undef asctime_r |
| 60 |
# undef ctime_r |
| 61 |
# undef gmtime_r |
| 62 |
# undef localtime_r |
| 63 |
# undef rand_r |
| 64 |
# undef strtok_r |
| 65 |
# else |
| 66 |
|
| 67 |
# ifdef __cplusplus |
| 68 |
extern "C" { |
| 69 |
# endif |
| 70 |
|
| 71 |
# if !GNULIB_defined_struct_timespec |
| 72 |
# undef timespec |
| 73 |
# define timespec rpl_timespec |
| 74 |
struct timespec |
| 75 |
{ |
| 76 |
time_t tv_sec; |
| 77 |
long int tv_nsec; |
| 78 |
}; |
| 79 |
# define GNULIB_defined_struct_timespec 1 |
| 80 |
# endif |
| 81 |
|
| 82 |
# ifdef __cplusplus |
| 83 |
} |
| 84 |
# endif |
| 85 |
|
| 86 |
# endif |
| 87 |
# endif |
| 88 |
|
| 89 |
# if !GNULIB_defined_struct_time_t_must_be_integral |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
struct __time_t_must_be_integral { |
| 96 |
unsigned int __floating_time_t_unsupported : (time_t) 1; |
| 97 |
}; |
| 98 |
# define GNULIB_defined_struct_time_t_must_be_integral 1 |
| 99 |
# endif |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
# if @GNULIB_NANOSLEEP@ |
| 105 |
# if @REPLACE_NANOSLEEP@ |
| 106 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 107 |
# define nanosleep rpl_nanosleep |
| 108 |
# endif |
| 109 |
_GL_FUNCDECL_RPL (nanosleep, int, |
| 110 |
(struct timespec const *__rqtp, struct timespec *__rmtp) |
| 111 |
_GL_ARG_NONNULL ((1))); |
| 112 |
_GL_CXXALIAS_RPL (nanosleep, int, |
| 113 |
(struct timespec const *__rqtp, struct timespec *__rmtp)); |
| 114 |
# else |
| 115 |
# if ! @HAVE_NANOSLEEP@ |
| 116 |
_GL_FUNCDECL_SYS (nanosleep, int, |
| 117 |
(struct timespec const *__rqtp, struct timespec *__rmtp) |
| 118 |
_GL_ARG_NONNULL ((1))); |
| 119 |
# endif |
| 120 |
_GL_CXXALIAS_SYS (nanosleep, int, |
| 121 |
(struct timespec const *__rqtp, struct timespec *__rmtp)); |
| 122 |
# endif |
| 123 |
_GL_CXXALIASWARN (nanosleep); |
| 124 |
# endif |
| 125 |
|
| 126 |
|
| 127 |
# if @GNULIB_MKTIME@ |
| 128 |
# if @REPLACE_MKTIME@ |
| 129 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 130 |
# define mktime rpl_mktime |
| 131 |
# endif |
| 132 |
_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); |
| 133 |
_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); |
| 134 |
# else |
| 135 |
_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); |
| 136 |
# endif |
| 137 |
_GL_CXXALIASWARN (mktime); |
| 138 |
# endif |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
# if @GNULIB_TIME_R@ |
| 144 |
# if @REPLACE_LOCALTIME_R@ |
| 145 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 146 |
# undef localtime_r |
| 147 |
# define localtime_r rpl_localtime_r |
| 148 |
# endif |
| 149 |
_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 150 |
struct tm *restrict __result) |
| 151 |
_GL_ARG_NONNULL ((1, 2))); |
| 152 |
_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 153 |
struct tm *restrict __result)); |
| 154 |
# else |
| 155 |
# if ! @HAVE_DECL_LOCALTIME_R@ |
| 156 |
_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 157 |
struct tm *restrict __result) |
| 158 |
_GL_ARG_NONNULL ((1, 2))); |
| 159 |
# endif |
| 160 |
_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 161 |
struct tm *restrict __result)); |
| 162 |
# endif |
| 163 |
# if @HAVE_DECL_LOCALTIME_R@ |
| 164 |
_GL_CXXALIASWARN (localtime_r); |
| 165 |
# endif |
| 166 |
# if @REPLACE_LOCALTIME_R@ |
| 167 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 168 |
# undef gmtime_r |
| 169 |
# define gmtime_r rpl_gmtime_r |
| 170 |
# endif |
| 171 |
_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 172 |
struct tm *restrict __result) |
| 173 |
_GL_ARG_NONNULL ((1, 2))); |
| 174 |
_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 175 |
struct tm *restrict __result)); |
| 176 |
# else |
| 177 |
# if ! @HAVE_DECL_LOCALTIME_R@ |
| 178 |
_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 179 |
struct tm *restrict __result) |
| 180 |
_GL_ARG_NONNULL ((1, 2))); |
| 181 |
# endif |
| 182 |
_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 183 |
struct tm *restrict __result)); |
| 184 |
# endif |
| 185 |
# if @HAVE_DECL_LOCALTIME_R@ |
| 186 |
_GL_CXXALIASWARN (gmtime_r); |
| 187 |
# endif |
| 188 |
# endif |
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
# if @GNULIB_STRPTIME@ |
| 194 |
# if ! @HAVE_STRPTIME@ |
| 195 |
_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, |
| 196 |
char const *restrict __format, |
| 197 |
struct tm *restrict __tm) |
| 198 |
_GL_ARG_NONNULL ((1, 2, 3))); |
| 199 |
# endif |
| 200 |
_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, |
| 201 |
char const *restrict __format, |
| 202 |
struct tm *restrict __tm)); |
| 203 |
_GL_CXXALIASWARN (strptime); |
| 204 |
# endif |
| 205 |
|
| 206 |
|
| 207 |
# if @GNULIB_TIMEGM@ |
| 208 |
# if @REPLACE_TIMEGM@ |
| 209 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 210 |
# undef timegm |
| 211 |
# define timegm rpl_timegm |
| 212 |
# endif |
| 213 |
_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); |
| 214 |
_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); |
| 215 |
# else |
| 216 |
# if ! @HAVE_TIMEGM@ |
| 217 |
_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); |
| 218 |
# endif |
| 219 |
_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); |
| 220 |
# endif |
| 221 |
_GL_CXXALIASWARN (timegm); |
| 222 |
# endif |
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
# if defined GNULIB_POSIXCHECK |
| 228 |
# undef asctime |
| 229 |
_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " |
| 230 |
"better use strftime (or even sprintf) instead"); |
| 231 |
# endif |
| 232 |
# if defined GNULIB_POSIXCHECK |
| 233 |
# undef asctime_r |
| 234 |
_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " |
| 235 |
"better use strftime (or even sprintf) instead"); |
| 236 |
# endif |
| 237 |
# if defined GNULIB_POSIXCHECK |
| 238 |
# undef ctime |
| 239 |
_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " |
| 240 |
"better use strftime (or even sprintf) instead"); |
| 241 |
# endif |
| 242 |
# if defined GNULIB_POSIXCHECK |
| 243 |
# undef ctime_r |
| 244 |
_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " |
| 245 |
"better use strftime (or even sprintf) instead"); |
| 246 |
# endif |
| 247 |
|
| 248 |
#endif |