00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if __GNUC__ >= 3
00023 #pragma GCC system_header
00024 #endif
00025
00026
00027
00028
00029
00030
00031
00032 #if (defined __need_time_t || defined __need_clock_t \
00033 || defined __need_timespec \
00034 || defined _GL_TIME_H)
00035
00036 # include_next <time.h>
00037
00038 #else
00039
00040 # define _GL_TIME_H
00041
00042 # include_next <time.h>
00043
00044
00045 # include <stddef.h>
00046
00047
00048 #ifndef _GL_CXXDEFS_H
00049 #define _GL_CXXDEFS_H
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 #if defined __cplusplus
00113 # define _GL_EXTERN_C extern "C"
00114 #else
00115 # define _GL_EXTERN_C extern
00116 #endif
00117
00118
00119
00120
00121
00122
00123
00124
00125 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
00126 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
00127 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
00128 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
00129
00130
00131
00132
00133
00134
00135
00136
00137 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
00138 _GL_EXTERN_C rettype func parameters_and_attributes
00139
00140
00141
00142
00143
00144
00145
00146 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
00147 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
00148 #if defined __cplusplus && defined GNULIB_NAMESPACE
00149 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00150 namespace GNULIB_NAMESPACE \
00151 { \
00152 rettype (*const func) parameters = ::rpl_func; \
00153 } \
00154 _GL_EXTERN_C int _gl_cxxalias_dummy
00155 #else
00156 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00157 _GL_EXTERN_C int _gl_cxxalias_dummy
00158 #endif
00159
00160
00161
00162
00163
00164
00165 #if defined __cplusplus && defined GNULIB_NAMESPACE
00166 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00167 namespace GNULIB_NAMESPACE \
00168 { \
00169 rettype (*const func) parameters = \
00170 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
00171 } \
00172 _GL_EXTERN_C int _gl_cxxalias_dummy
00173 #else
00174 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00175 _GL_EXTERN_C int _gl_cxxalias_dummy
00176 #endif
00177
00178
00179
00180
00181
00182
00183
00184
00185 #if defined __cplusplus && defined GNULIB_NAMESPACE
00186
00187
00188
00189
00190
00191
00192 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00193 namespace GNULIB_NAMESPACE \
00194 { \
00195 static rettype (*func) parameters = ::func; \
00196 } \
00197 _GL_EXTERN_C int _gl_cxxalias_dummy
00198 #else
00199 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00200 _GL_EXTERN_C int _gl_cxxalias_dummy
00201 #endif
00202
00203
00204
00205
00206
00207
00208 #if defined __cplusplus && defined GNULIB_NAMESPACE
00209 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00210 namespace GNULIB_NAMESPACE \
00211 { \
00212 static rettype (*func) parameters = \
00213 reinterpret_cast<rettype(*)parameters>(::func); \
00214 } \
00215 _GL_EXTERN_C int _gl_cxxalias_dummy
00216 #else
00217 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00218 _GL_EXTERN_C int _gl_cxxalias_dummy
00219 #endif
00220
00221
00222
00223
00224
00225
00226
00227 #if defined __cplusplus && defined GNULIB_NAMESPACE
00228
00229
00230
00231
00232
00233 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00234 namespace GNULIB_NAMESPACE \
00235 { \
00236 static rettype (*func) parameters = \
00237 reinterpret_cast<rettype(*)parameters>( \
00238 (rettype2(*)parameters2)(::func)); \
00239 } \
00240 _GL_EXTERN_C int _gl_cxxalias_dummy
00241 #else
00242 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00243 _GL_EXTERN_C int _gl_cxxalias_dummy
00244 #endif
00245
00246
00247
00248
00249
00250 #if defined __cplusplus && defined GNULIB_NAMESPACE
00251 # define _GL_CXXALIASWARN(func) \
00252 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
00253 # define _GL_CXXALIASWARN_1(func,namespace) \
00254 _GL_CXXALIASWARN_2 (func, namespace)
00255
00256
00257 # if !__OPTIMIZE__
00258 # define _GL_CXXALIASWARN_2(func,namespace) \
00259 _GL_WARN_ON_USE (func, \
00260 "The symbol ::" #func " refers to the system function. " \
00261 "Use " #namespace "::" #func " instead.")
00262 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00263 # define _GL_CXXALIASWARN_2(func,namespace) \
00264 extern __typeof__ (func) func
00265 # else
00266 # define _GL_CXXALIASWARN_2(func,namespace) \
00267 _GL_EXTERN_C int _gl_cxxalias_dummy
00268 # endif
00269 #else
00270 # define _GL_CXXALIASWARN(func) \
00271 _GL_EXTERN_C int _gl_cxxalias_dummy
00272 #endif
00273
00274
00275
00276
00277 #if defined __cplusplus && defined GNULIB_NAMESPACE
00278 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00279 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
00280 GNULIB_NAMESPACE)
00281 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
00282 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
00283
00284
00285 # if !__OPTIMIZE__
00286 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00287 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
00288 "The symbol ::" #func " refers to the system function. " \
00289 "Use " #namespace "::" #func " instead.")
00290 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00291 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00292 extern __typeof__ (func) func
00293 # else
00294 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00295 _GL_EXTERN_C int _gl_cxxalias_dummy
00296 # endif
00297 #else
00298 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00299 _GL_EXTERN_C int _gl_cxxalias_dummy
00300 #endif
00301
00302 #endif
00303
00304
00305
00306
00307
00308 #ifndef _GL_ARG_NONNULL
00309 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
00310 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
00311 # else
00312 # define _GL_ARG_NONNULL(params)
00313 # endif
00314 #endif
00315
00316
00317 #ifndef _GL_WARN_ON_USE
00318
00319 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00320
00321 # define _GL_WARN_ON_USE(function, message) \
00322 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
00323 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00324
00325 # define _GL_WARN_ON_USE(function, message) \
00326 extern __typeof__ (function) function
00327 # else
00328 # define _GL_WARN_ON_USE(function, message) \
00329 _GL_WARN_EXTERN_C int _gl_warn_on_use
00330 # endif
00331 #endif
00332
00333
00334
00335
00336
00337
00338
00339 #ifndef _GL_WARN_ON_USE_CXX
00340 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00341 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00342 extern rettype function parameters_and_attributes \
00343 __attribute__ ((__warning__ (msg)))
00344 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00345
00346 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00347 extern rettype function parameters_and_attributes
00348 # else
00349 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00350 _GL_WARN_EXTERN_C int _gl_warn_on_use
00351 # endif
00352 #endif
00353
00354
00355
00356 #ifndef _GL_WARN_EXTERN_C
00357 # if defined __cplusplus
00358 # define _GL_WARN_EXTERN_C extern "C"
00359 # else
00360 # define _GL_WARN_EXTERN_C extern
00361 # endif
00362 #endif
00363
00364
00365
00366
00367
00368 # if ! 1
00369 # if 0
00370 # include <sys/time.h>
00371 # elif 0
00372 # include <pthread.h>
00373
00374 # undef asctime_r
00375 # undef ctime_r
00376 # undef gmtime_r
00377 # undef localtime_r
00378 # undef rand_r
00379 # undef strtok_r
00380 # else
00381
00382 # ifdef __cplusplus
00383 extern "C" {
00384 # endif
00385
00386 # if !GNULIB_defined_struct_timespec
00387 # undef timespec
00388 # define timespec rpl_timespec
00389 struct timespec
00390 {
00391 time_t tv_sec;
00392 long int tv_nsec;
00393 };
00394 # define GNULIB_defined_struct_timespec 1
00395 # endif
00396
00397 # ifdef __cplusplus
00398 }
00399 # endif
00400
00401 # endif
00402 # endif
00403
00404 # if !GNULIB_defined_struct_time_t_must_be_integral
00405
00406
00407
00408
00409
00410 struct __time_t_must_be_integral {
00411 unsigned int __floating_time_t_unsupported : (time_t) 1;
00412 };
00413 # define GNULIB_defined_struct_time_t_must_be_integral 1
00414 # endif
00415
00416
00417
00418
00419 # if 1
00420 # if 0
00421 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00422 # define nanosleep rpl_nanosleep
00423 # endif
00424 _GL_FUNCDECL_RPL (nanosleep, int,
00425 (struct timespec const *__rqtp, struct timespec *__rmtp)
00426 _GL_ARG_NONNULL ((1)));
00427 _GL_CXXALIAS_RPL (nanosleep, int,
00428 (struct timespec const *__rqtp, struct timespec *__rmtp));
00429 # else
00430 # if ! 1
00431 _GL_FUNCDECL_SYS (nanosleep, int,
00432 (struct timespec const *__rqtp, struct timespec *__rmtp)
00433 _GL_ARG_NONNULL ((1)));
00434 # endif
00435 _GL_CXXALIAS_SYS (nanosleep, int,
00436 (struct timespec const *__rqtp, struct timespec *__rmtp));
00437 # endif
00438 _GL_CXXALIASWARN (nanosleep);
00439 # endif
00440
00441
00442 # if 1
00443 # if 0
00444 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00445 # define mktime rpl_mktime
00446 # endif
00447 _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
00448 _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
00449 # else
00450 _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
00451 # endif
00452 _GL_CXXALIASWARN (mktime);
00453 # endif
00454
00455
00456
00457
00458 # if 1
00459 # if 0
00460 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00461 # undef localtime_r
00462 # define localtime_r rpl_localtime_r
00463 # endif
00464 _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
00465 struct tm *restrict __result)
00466 _GL_ARG_NONNULL ((1, 2)));
00467 _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
00468 struct tm *restrict __result));
00469 # else
00470 # if ! 0
00471 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
00472 struct tm *restrict __result)
00473 _GL_ARG_NONNULL ((1, 2)));
00474 # endif
00475 _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
00476 struct tm *restrict __result));
00477 # endif
00478 # if 0
00479 _GL_CXXALIASWARN (localtime_r);
00480 # endif
00481 # if 0
00482 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00483 # undef gmtime_r
00484 # define gmtime_r rpl_gmtime_r
00485 # endif
00486 _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
00487 struct tm *restrict __result)
00488 _GL_ARG_NONNULL ((1, 2)));
00489 _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
00490 struct tm *restrict __result));
00491 # else
00492 # if ! 0
00493 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
00494 struct tm *restrict __result)
00495 _GL_ARG_NONNULL ((1, 2)));
00496 # endif
00497 _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
00498 struct tm *restrict __result));
00499 # endif
00500 # if 0
00501 _GL_CXXALIASWARN (gmtime_r);
00502 # endif
00503 # endif
00504
00505
00506
00507
00508 # if 1
00509 # if ! 1
00510 _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
00511 char const *restrict __format,
00512 struct tm *restrict __tm)
00513 _GL_ARG_NONNULL ((1, 2, 3)));
00514 # endif
00515 _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
00516 char const *restrict __format,
00517 struct tm *restrict __tm));
00518 _GL_CXXALIASWARN (strptime);
00519 # endif
00520
00521
00522 # if 0
00523 # if GNULIB_PORTCHECK
00524 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00525 # undef timegm
00526 # define timegm rpl_timegm
00527 # endif
00528 _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
00529 _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
00530 # else
00531 # if ! 1
00532 _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
00533 # endif
00534 _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
00535 # endif
00536 _GL_CXXALIASWARN (timegm);
00537 # endif
00538
00539
00540
00541
00542 # if defined GNULIB_POSIXCHECK
00543 # undef asctime
00544 _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
00545 "better use strftime (or even sprintf) instead");
00546 # endif
00547 # if defined GNULIB_POSIXCHECK
00548 # undef asctime_r
00549 _GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - "
00550 "better use strftime (or even sprintf) instead");
00551 # endif
00552 # if defined GNULIB_POSIXCHECK
00553 # undef ctime
00554 _GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - "
00555 "better use strftime (or even sprintf) instead");
00556 # endif
00557 # if defined GNULIB_POSIXCHECK
00558 # undef ctime_r
00559 _GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - "
00560 "better use strftime (or even sprintf) instead");
00561 # endif
00562
00563 #endif