20 #pragma GCC system_header 24 #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc 28 #include_next <stdlib.h> 36 #include_next <stdlib.h> 45 #if 0 && !defined WEXITSTATUS 46 # include <sys/wait.h> 50 #if (0 || defined GNULIB_POSIXCHECK) && 0 51 # include <sys/loadavg.h> 55 #if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 75 # if !GNULIB_defined_struct_random_data 86 # define GNULIB_defined_struct_random_data 1 91 #if (0 || 0 || 0 || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 101 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) 102 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) 104 # define _GL_ATTRIBUTE_PURE 108 #if !defined _Noreturn && __STDC_VERSION__ < 201112 109 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ 110 || 0x5110 <= __SUNPRO_C) 111 # define _Noreturn __attribute__ ((__noreturn__)) 112 # elif 1200 <= _MSC_VER 113 # define _Noreturn __declspec (noreturn) 136 #ifndef _GL_CXXDEFS_H 137 #define _GL_CXXDEFS_H 140 #if defined __cplusplus && defined GNULIB_NAMESPACE 141 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { 142 # define _GL_END_NAMESPACE } 144 # define _GL_BEGIN_NAMESPACE 145 # define _GL_END_NAMESPACE 209 #if defined __cplusplus 210 # define _GL_EXTERN_C extern "C" 212 # define _GL_EXTERN_C extern 222 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ 223 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) 224 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ 225 _GL_EXTERN_C rettype rpl_func parameters_and_attributes 234 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ 235 _GL_EXTERN_C rettype func parameters_and_attributes 246 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ 247 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) 248 #if defined __cplusplus && defined GNULIB_NAMESPACE 249 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 250 namespace GNULIB_NAMESPACE \ 252 static const struct _gl_ ## func ## _wrapper \ 254 typedef rettype (*type) parameters; \ 256 inline operator type () const \ 262 _GL_EXTERN_C int _gl_cxxalias_dummy 264 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 265 _GL_EXTERN_C int _gl_cxxalias_dummy 273 #if defined __cplusplus && defined GNULIB_NAMESPACE 274 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 275 namespace GNULIB_NAMESPACE \ 277 static const struct _gl_ ## func ## _wrapper \ 279 typedef rettype (*type) parameters; \ 281 inline operator type () const \ 283 return reinterpret_cast<type>(::rpl_func); \ 287 _GL_EXTERN_C int _gl_cxxalias_dummy 289 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 290 _GL_EXTERN_C int _gl_cxxalias_dummy 303 #if defined __cplusplus && defined GNULIB_NAMESPACE 304 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 305 namespace GNULIB_NAMESPACE \ 307 static const struct _gl_ ## func ## _wrapper \ 309 typedef rettype (*type) parameters; \ 311 inline operator type () const \ 317 _GL_EXTERN_C int _gl_cxxalias_dummy 319 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 320 _GL_EXTERN_C int _gl_cxxalias_dummy 328 #if defined __cplusplus && defined GNULIB_NAMESPACE 329 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 330 namespace GNULIB_NAMESPACE \ 332 static const struct _gl_ ## func ## _wrapper \ 334 typedef rettype (*type) parameters; \ 336 inline operator type () const \ 338 return reinterpret_cast<type>(::func); \ 342 _GL_EXTERN_C int _gl_cxxalias_dummy 344 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 345 _GL_EXTERN_C int _gl_cxxalias_dummy 354 #if defined __cplusplus && defined GNULIB_NAMESPACE 360 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 361 namespace GNULIB_NAMESPACE \ 363 static const struct _gl_ ## func ## _wrapper \ 365 typedef rettype (*type) parameters; \ 367 inline operator type () const \ 369 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ 373 _GL_EXTERN_C int _gl_cxxalias_dummy 375 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 376 _GL_EXTERN_C int _gl_cxxalias_dummy 383 #if defined __cplusplus && defined GNULIB_NAMESPACE 384 # define _GL_CXXALIASWARN(func) \ 385 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 386 # define _GL_CXXALIASWARN_1(func,namespace) \ 387 _GL_CXXALIASWARN_2 (func, namespace) 391 # define _GL_CXXALIASWARN_2(func,namespace) \ 392 _GL_WARN_ON_USE (func, \ 393 "The symbol ::" #func " refers to the system function. " \ 394 "Use " #namespace "::" #func " instead.") 395 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 396 # define _GL_CXXALIASWARN_2(func,namespace) \ 397 extern __typeof__ (func) func 399 # define _GL_CXXALIASWARN_2(func,namespace) \ 400 _GL_EXTERN_C int _gl_cxxalias_dummy 403 # define _GL_CXXALIASWARN(func) \ 404 _GL_EXTERN_C int _gl_cxxalias_dummy 410 #if defined __cplusplus && defined GNULIB_NAMESPACE 411 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 412 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 414 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 415 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 419 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 420 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ 421 "The symbol ::" #func " refers to the system function. " \ 422 "Use " #namespace "::" #func " instead.") 423 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 424 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 425 extern __typeof__ (func) func 427 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 428 _GL_EXTERN_C int _gl_cxxalias_dummy 431 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 432 _GL_EXTERN_C int _gl_cxxalias_dummy 457 #ifndef _GL_ARG_NONNULL 458 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 459 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 461 # define _GL_ARG_NONNULL(params) 529 #ifndef _GL_WARN_ON_USE 531 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 533 # define _GL_WARN_ON_USE(function, message) \ 534 extern __typeof__ (function) function __attribute__ ((__warning__ (message))) 535 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 537 # define _GL_WARN_ON_USE(function, message) \ 538 extern __typeof__ (function) function 540 # define _GL_WARN_ON_USE(function, message) \ 541 _GL_WARN_EXTERN_C int _gl_warn_on_use 551 #ifndef _GL_WARN_ON_USE_CXX 552 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 553 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 554 extern rettype function parameters_and_attributes \ 555 __attribute__ ((__warning__ (msg))) 556 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 558 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 559 extern rettype function parameters_and_attributes 561 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 562 _GL_WARN_EXTERN_C int _gl_warn_on_use 568 #ifndef _GL_WARN_EXTERN_C 569 # if defined __cplusplus 570 # define _GL_WARN_EXTERN_C extern "C" 572 # define _GL_WARN_EXTERN_C extern 579 # define EXIT_SUCCESS 0 584 # define EXIT_FAILURE 1 585 #elif EXIT_FAILURE != 1 587 # define EXIT_FAILURE 1 599 #elif defined GNULIB_POSIXCHECK 601 # if HAVE_RAW_DECL__EXIT 603 "use gnulib module _Exit for portability");
618 #elif defined GNULIB_POSIXCHECK 620 # if HAVE_RAW_DECL_ATOLL 622 "use gnulib module atoll for portability");
628 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 630 # define calloc rpl_calloc 638 #elif defined GNULIB_POSIXCHECK 642 "use gnulib module calloc-posix for portability");
647 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 648 # define canonicalize_file_name rpl_canonicalize_file_name 661 #elif defined GNULIB_POSIXCHECK 662 # undef canonicalize_file_name 663 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME 665 "canonicalize_file_name is unportable - " 666 "use gnulib module canonicalize-lgpl for portability");
681 #elif defined GNULIB_POSIXCHECK 683 # if HAVE_RAW_DECL_GETLOADAVG 685 "use gnulib module getloadavg for portability");
703 (
char **optionp,
char *
const *tokens,
char **valuep)
707 (
char **optionp,
char *
const *tokens,
char **valuep));
709 #elif defined GNULIB_POSIXCHECK 711 # if HAVE_RAW_DECL_GETSUBOPT 713 "use gnulib module getsubopt for portability");
725 #elif defined GNULIB_POSIXCHECK 727 # if HAVE_RAW_DECL_GRANTPT 729 "use gnulib module grantpt for portability");
739 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ 740 || _GL_USE_STDLIB_ALLOC) 742 # define malloc rpl_malloc 750 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC 754 "use gnulib module malloc-posix for portability");
760 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 762 # define mbtowc rpl_mbtowc 783 #elif defined GNULIB_POSIXCHECK 785 # if HAVE_RAW_DECL_MKDTEMP 787 "use gnulib module mkdtemp for portability");
810 #elif defined GNULIB_POSIXCHECK 812 # if HAVE_RAW_DECL_MKOSTEMP 814 "use gnulib module mkostemp for portability");
834 (
char * ,
int ,
int )
838 (
char * ,
int ,
int ));
840 #elif defined GNULIB_POSIXCHECK 842 # if HAVE_RAW_DECL_MKOSTEMPS 844 "use gnulib module mkostemps for portability");
859 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 860 # define mkstemp rpl_mkstemp 871 #elif defined GNULIB_POSIXCHECK 873 # if HAVE_RAW_DECL_MKSTEMP 875 "use gnulib module mkstemp for portability");
896 #elif defined GNULIB_POSIXCHECK 898 # if HAVE_RAW_DECL_MKSTEMPS 900 "use gnulib module mkstemps for portability");
912 #elif defined GNULIB_POSIXCHECK 914 # if HAVE_RAW_DECL_POSIX_OPENPT 916 "use gnulib module posix_openpt for portability");
924 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 926 # define ptsname rpl_ptsname 937 #elif defined GNULIB_POSIXCHECK 939 # if HAVE_RAW_DECL_PTSNAME 941 "use gnulib module ptsname for portability");
950 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 952 # define ptsname_r rpl_ptsname_r 963 #elif defined GNULIB_POSIXCHECK 965 # if HAVE_RAW_DECL_PTSNAME_R 967 "use gnulib module ptsname_r for portability");
973 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 975 # define putenv rpl_putenv 990 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 992 # define qsort_r rpl_qsort_r 995 int (*compare) (
void const *,
void const *,
999 int (*compare) (
void const *,
void const *,
1005 int (*compare) (
void const *,
void const *,
1010 int (*compare) (
void const *,
void const *,
1015 #elif defined GNULIB_POSIXCHECK 1017 # if HAVE_RAW_DECL_QSORT_R 1019 "use gnulib module qsort_r for portability");
1027 # define RAND_MAX 2147483647 1039 #elif defined GNULIB_POSIXCHECK 1041 # if HAVE_RAW_DECL_RANDOM 1043 "use gnulib module random for portability");
1053 #elif defined GNULIB_POSIXCHECK 1055 # if HAVE_RAW_DECL_SRANDOM 1057 "use gnulib module random for portability");
1064 (
unsigned int seed,
char *buf,
size_t buf_size)
1068 (
unsigned int seed,
char *buf,
size_t buf_size));
1070 #elif defined GNULIB_POSIXCHECK 1072 # if HAVE_RAW_DECL_INITSTATE_R 1074 "use gnulib module random for portability");
1084 #elif defined GNULIB_POSIXCHECK 1086 # if HAVE_RAW_DECL_SETSTATE_R 1088 "use gnulib module random for portability");
1095 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1097 # define random_r rpl_random_r 1110 #elif defined GNULIB_POSIXCHECK 1112 # if HAVE_RAW_DECL_RANDOM_R 1114 "use gnulib module random_r for portability");
1120 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1122 # define srandom_r rpl_srandom_r 1125 (
unsigned int seed,
struct random_data *rand_state)
1128 (
unsigned int seed,
struct random_data *rand_state));
1132 (
unsigned int seed,
struct random_data *rand_state)
1136 (
unsigned int seed,
struct random_data *rand_state));
1139 #elif defined GNULIB_POSIXCHECK 1141 # if HAVE_RAW_DECL_SRANDOM_R 1143 "use gnulib module random_r for portability");
1149 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1151 # define initstate_r rpl_initstate_r 1154 (
unsigned int seed,
char *buf,
size_t buf_size,
1155 struct random_data *rand_state)
1158 (
unsigned int seed,
char *buf,
size_t buf_size,
1159 struct random_data *rand_state));
1163 (
unsigned int seed,
char *buf,
size_t buf_size,
1164 struct random_data *rand_state)
1168 (
unsigned int seed,
char *buf,
size_t buf_size,
1169 struct random_data *rand_state));
1172 #elif defined GNULIB_POSIXCHECK 1174 # if HAVE_RAW_DECL_INITSTATE_R 1176 "use gnulib module random_r for portability");
1182 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1184 # define setstate_r rpl_setstate_r 1187 (
char *arg_state,
struct random_data *rand_state)
1190 (
char *arg_state,
struct random_data *rand_state));
1194 (
char *arg_state,
struct random_data *rand_state)
1198 (
char *arg_state,
struct random_data *rand_state));
1201 #elif defined GNULIB_POSIXCHECK 1203 # if HAVE_RAW_DECL_SETSTATE_R 1205 "use gnulib module random_r for portability");
1212 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ 1213 || _GL_USE_STDLIB_ALLOC) 1215 # define realloc rpl_realloc 1223 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC 1226 _GL_WARN_ON_USE (realloc,
"realloc is not POSIX compliant everywhere - " 1227 "use gnulib module realloc-posix for portability");
1234 (
void *ptr,
size_t nmemb,
size_t size));
1237 (
void *ptr,
size_t nmemb,
size_t size));
1239 #elif defined GNULIB_POSIXCHECK 1240 # undef reallocarray 1241 # if HAVE_RAW_DECL_REALLOCARRAY 1243 "use gnulib module reallocarray for portability");
1249 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1250 # define realpath rpl_realpath 1263 #elif defined GNULIB_POSIXCHECK 1265 # if HAVE_RAW_DECL_REALPATH 1266 _GL_WARN_ON_USE (realpath,
"realpath is unportable - use gnulib module " 1267 "canonicalize or canonicalize-lgpl for portability");
1279 #elif defined GNULIB_POSIXCHECK 1281 # if HAVE_RAW_DECL_RPMATCH 1283 "use gnulib module rpmatch for portability");
1295 #elif defined GNULIB_POSIXCHECK 1296 # undef secure_getenv 1297 # if HAVE_RAW_DECL_SECURE_GETENV 1299 "use gnulib module secure_getenv for portability");
1307 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1309 # define setenv rpl_setenv 1312 (
const char *name,
const char *value,
int replace)
1315 (
const char *name,
const char *value,
int replace));
1319 (
const char *name,
const char *value,
int replace)
1323 (
const char *name,
const char *value,
int replace));
1328 #elif defined GNULIB_POSIXCHECK 1330 # if HAVE_RAW_DECL_SETENV 1332 "use gnulib module setenv for portability");
1339 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1340 # define strtod rpl_strtod 1353 #elif defined GNULIB_POSIXCHECK 1355 # if HAVE_RAW_DECL_STRTOD 1357 "use gnulib module strtod for portability");
1372 (
const char *
string,
char **endptr,
int base)
1376 (
const char *
string,
char **endptr,
int base));
1378 #elif defined GNULIB_POSIXCHECK 1380 # if HAVE_RAW_DECL_STRTOLL 1382 "use gnulib module strtoll for portability");
1397 (
const char *
string,
char **endptr,
int base)
1401 (
const char *
string,
char **endptr,
int base));
1403 #elif defined GNULIB_POSIXCHECK 1405 # if HAVE_RAW_DECL_STRTOULL 1407 "use gnulib module strtoull for portability");
1419 #elif defined GNULIB_POSIXCHECK 1421 # if HAVE_RAW_DECL_UNLOCKPT 1423 "use gnulib module unlockpt for portability");
1430 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1432 # define unsetenv rpl_unsetenv 1445 #elif defined GNULIB_POSIXCHECK 1447 # if HAVE_RAW_DECL_UNSETENV 1449 "use gnulib module unsetenv for portability");
1456 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1458 # define wctomb rpl_wctomb #define _GL_ARG_NONNULL(params)
Definition: stdlib.h:461
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: stdlib.h:222
#define _GL_CXXALIASWARN(func)
Definition: stdlib.h:403
#define _Noreturn
Definition: stdlib.h:115
int unsetenv(const char *name)
Definition: unsetenv.c:57
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: stdlib.h:234
double strtod(const char *nptr, char **endptr)
Definition: strtod.c:208
#define _GL_WARN_ON_USE(function, message)
Definition: stdlib.h:540
#define _GL_ATTRIBUTE_PURE
Definition: stdlib.h:104
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: stdlib.h:246
int setenv(const char *name, const char *value, int replace)
Definition: setenv.c:291
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: stdlib.h:319
#define int32_t
Definition: stdint.in.h:167