| 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 |
#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
| 28 |
|
| 29 |
#else |
| 30 |
|
| 31 |
|
| 32 |
#ifndef _@GUARD_PREFIX@_STDLIB_H |
| 33 |
|
| 34 |
|
| 35 |
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
| 36 |
|
| 37 |
#ifndef _@GUARD_PREFIX@_STDLIB_H |
| 38 |
#define _@GUARD_PREFIX@_STDLIB_H |
| 39 |
|
| 40 |
|
| 41 |
#include <stddef.h> |
| 42 |
|
| 43 |
|
| 44 |
#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS |
| 45 |
# include <sys/wait.h> |
| 46 |
#endif |
| 47 |
|
| 48 |
|
| 49 |
#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ |
| 50 |
# include <sys/loadavg.h> |
| 51 |
#endif |
| 52 |
|
| 53 |
|
| 54 |
#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) |
| 55 |
# include <io.h> |
| 56 |
#endif |
| 57 |
|
| 58 |
#if @GNULIB_RANDOM_R@ |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
# if @HAVE_RANDOM_H@ |
| 64 |
# include <random.h> |
| 65 |
# endif |
| 66 |
|
| 67 |
# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@ |
| 68 |
# include <stdint.h> |
| 69 |
# endif |
| 70 |
|
| 71 |
# if !@HAVE_STRUCT_RANDOM_DATA@ |
| 72 |
|
| 73 |
|
| 74 |
# if !GNULIB_defined_struct_random_data |
| 75 |
struct random_data |
| 76 |
{ |
| 77 |
int32_t *fptr; |
| 78 |
int32_t *rptr; |
| 79 |
int32_t *state; |
| 80 |
int rand_type; |
| 81 |
int rand_deg; |
| 82 |
int rand_sep; |
| 83 |
int32_t *end_ptr; |
| 84 |
}; |
| 85 |
# define GNULIB_defined_struct_random_data 1 |
| 86 |
# endif |
| 87 |
# endif |
| 88 |
#endif |
| 89 |
|
| 90 |
#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
# include <unistd.h> |
| 96 |
#endif |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) |
| 101 |
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
| 102 |
#else |
| 103 |
# define _GL_ATTRIBUTE_PURE |
| 104 |
#endif |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
#ifndef EXIT_SUCCESS |
| 117 |
# define EXIT_SUCCESS 0 |
| 118 |
#endif |
| 119 |
|
| 120 |
|
| 121 |
#ifndef EXIT_FAILURE |
| 122 |
# define EXIT_FAILURE 1 |
| 123 |
#elif EXIT_FAILURE != 1 |
| 124 |
# undef EXIT_FAILURE |
| 125 |
# define EXIT_FAILURE 1 |
| 126 |
#endif |
| 127 |
|
| 128 |
|
| 129 |
#if @GNULIB__EXIT@ |
| 130 |
|
| 131 |
|
| 132 |
# if !@HAVE__EXIT@ |
| 133 |
_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); |
| 134 |
# endif |
| 135 |
_GL_CXXALIAS_SYS (_Exit, void, (int status)); |
| 136 |
_GL_CXXALIASWARN (_Exit); |
| 137 |
#elif defined GNULIB_POSIXCHECK |
| 138 |
# undef _Exit |
| 139 |
# if HAVE_RAW_DECL__EXIT |
| 140 |
_GL_WARN_ON_USE (_Exit, "_Exit is unportable - " |
| 141 |
"use gnulib module _Exit for portability"); |
| 142 |
# endif |
| 143 |
#endif |
| 144 |
|
| 145 |
|
| 146 |
#if @GNULIB_ATOLL@ |
| 147 |
|
| 148 |
|
| 149 |
# if !@HAVE_ATOLL@ |
| 150 |
_GL_FUNCDECL_SYS (atoll, long long, (const char *string) |
| 151 |
_GL_ATTRIBUTE_PURE |
| 152 |
_GL_ARG_NONNULL ((1))); |
| 153 |
# endif |
| 154 |
_GL_CXXALIAS_SYS (atoll, long long, (const char *string)); |
| 155 |
_GL_CXXALIASWARN (atoll); |
| 156 |
#elif defined GNULIB_POSIXCHECK |
| 157 |
# undef atoll |
| 158 |
# if HAVE_RAW_DECL_ATOLL |
| 159 |
_GL_WARN_ON_USE (atoll, "atoll is unportable - " |
| 160 |
"use gnulib module atoll for portability"); |
| 161 |
# endif |
| 162 |
#endif |
| 163 |
|
| 164 |
#if @GNULIB_CALLOC_POSIX@ |
| 165 |
# if @REPLACE_CALLOC@ |
| 166 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 167 |
# undef calloc |
| 168 |
# define calloc rpl_calloc |
| 169 |
# endif |
| 170 |
_GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size)); |
| 171 |
_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size)); |
| 172 |
# else |
| 173 |
_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); |
| 174 |
# endif |
| 175 |
_GL_CXXALIASWARN (calloc); |
| 176 |
#elif defined GNULIB_POSIXCHECK |
| 177 |
# undef calloc |
| 178 |
|
| 179 |
_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " |
| 180 |
"use gnulib module calloc-posix for portability"); |
| 181 |
#endif |
| 182 |
|
| 183 |
#if @GNULIB_CANONICALIZE_FILE_NAME@ |
| 184 |
# if @REPLACE_CANONICALIZE_FILE_NAME@ |
| 185 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 186 |
# define canonicalize_file_name rpl_canonicalize_file_name |
| 187 |
# endif |
| 188 |
_GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name) |
| 189 |
_GL_ARG_NONNULL ((1))); |
| 190 |
_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name)); |
| 191 |
# else |
| 192 |
# if !@HAVE_CANONICALIZE_FILE_NAME@ |
| 193 |
_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name) |
| 194 |
_GL_ARG_NONNULL ((1))); |
| 195 |
# endif |
| 196 |
_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); |
| 197 |
# endif |
| 198 |
_GL_CXXALIASWARN (canonicalize_file_name); |
| 199 |
#elif defined GNULIB_POSIXCHECK |
| 200 |
# undef canonicalize_file_name |
| 201 |
# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME |
| 202 |
_GL_WARN_ON_USE (canonicalize_file_name, |
| 203 |
"canonicalize_file_name is unportable - " |
| 204 |
"use gnulib module canonicalize-lgpl for portability"); |
| 205 |
# endif |
| 206 |
#endif |
| 207 |
|
| 208 |
#if @GNULIB_GETLOADAVG@ |
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
# if !@HAVE_DECL_GETLOADAVG@ |
| 214 |
_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem) |
| 215 |
_GL_ARG_NONNULL ((1))); |
| 216 |
# endif |
| 217 |
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); |
| 218 |
_GL_CXXALIASWARN (getloadavg); |
| 219 |
#elif defined GNULIB_POSIXCHECK |
| 220 |
# undef getloadavg |
| 221 |
# if HAVE_RAW_DECL_GETLOADAVG |
| 222 |
_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " |
| 223 |
"use gnulib module getloadavg for portability"); |
| 224 |
# endif |
| 225 |
#endif |
| 226 |
|
| 227 |
#if @GNULIB_GETSUBOPT@ |
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
# if !@HAVE_GETSUBOPT@ |
| 240 |
_GL_FUNCDECL_SYS (getsubopt, int, |
| 241 |
(char **optionp, char *const *tokens, char **valuep) |
| 242 |
_GL_ARG_NONNULL ((1, 2, 3))); |
| 243 |
# endif |
| 244 |
_GL_CXXALIAS_SYS (getsubopt, int, |
| 245 |
(char **optionp, char *const *tokens, char **valuep)); |
| 246 |
_GL_CXXALIASWARN (getsubopt); |
| 247 |
#elif defined GNULIB_POSIXCHECK |
| 248 |
# undef getsubopt |
| 249 |
# if HAVE_RAW_DECL_GETSUBOPT |
| 250 |
_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " |
| 251 |
"use gnulib module getsubopt for portability"); |
| 252 |
# endif |
| 253 |
#endif |
| 254 |
|
| 255 |
#if @GNULIB_GRANTPT@ |
| 256 |
|
| 257 |
|
| 258 |
# if !@HAVE_GRANTPT@ |
| 259 |
_GL_FUNCDECL_SYS (grantpt, int, (int fd)); |
| 260 |
# endif |
| 261 |
_GL_CXXALIAS_SYS (grantpt, int, (int fd)); |
| 262 |
_GL_CXXALIASWARN (grantpt); |
| 263 |
#elif defined GNULIB_POSIXCHECK |
| 264 |
# undef grantpt |
| 265 |
# if HAVE_RAW_DECL_GRANTPT |
| 266 |
_GL_WARN_ON_USE (grantpt, "grantpt is not portable - " |
| 267 |
"use gnulib module grantpt for portability"); |
| 268 |
# endif |
| 269 |
#endif |
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
#if @GNULIB_MALLOC_POSIX@ |
| 276 |
# if @REPLACE_MALLOC@ |
| 277 |
# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ |
| 278 |
|| _GL_USE_STDLIB_ALLOC) |
| 279 |
# undef malloc |
| 280 |
# define malloc rpl_malloc |
| 281 |
# endif |
| 282 |
_GL_FUNCDECL_RPL (malloc, void *, (size_t size)); |
| 283 |
_GL_CXXALIAS_RPL (malloc, void *, (size_t size)); |
| 284 |
# else |
| 285 |
_GL_CXXALIAS_SYS (malloc, void *, (size_t size)); |
| 286 |
# endif |
| 287 |
_GL_CXXALIASWARN (malloc); |
| 288 |
#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC |
| 289 |
# undef malloc |
| 290 |
|
| 291 |
_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " |
| 292 |
"use gnulib module malloc-posix for portability"); |
| 293 |
#endif |
| 294 |
|
| 295 |
|
| 296 |
#if @GNULIB_MBTOWC@ |
| 297 |
# if @REPLACE_MBTOWC@ |
| 298 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 299 |
# undef mbtowc |
| 300 |
# define mbtowc rpl_mbtowc |
| 301 |
# endif |
| 302 |
_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
| 303 |
_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
| 304 |
# else |
| 305 |
_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
| 306 |
# endif |
| 307 |
_GL_CXXALIASWARN (mbtowc); |
| 308 |
#endif |
| 309 |
|
| 310 |
#if @GNULIB_MKDTEMP@ |
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
# if !@HAVE_MKDTEMP@ |
| 317 |
_GL_FUNCDECL_SYS (mkdtemp, char *, (char * ) _GL_ARG_NONNULL ((1))); |
| 318 |
# endif |
| 319 |
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * )); |
| 320 |
_GL_CXXALIASWARN (mkdtemp); |
| 321 |
#elif defined GNULIB_POSIXCHECK |
| 322 |
# undef mkdtemp |
| 323 |
# if HAVE_RAW_DECL_MKDTEMP |
| 324 |
_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " |
| 325 |
"use gnulib module mkdtemp for portability"); |
| 326 |
# endif |
| 327 |
#endif |
| 328 |
|
| 329 |
#if @GNULIB_MKOSTEMP@ |
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
# if !@HAVE_MKOSTEMP@ |
| 343 |
_GL_FUNCDECL_SYS (mkostemp, int, (char * , int ) |
| 344 |
_GL_ARG_NONNULL ((1))); |
| 345 |
# endif |
| 346 |
_GL_CXXALIAS_SYS (mkostemp, int, (char * , int )); |
| 347 |
_GL_CXXALIASWARN (mkostemp); |
| 348 |
#elif defined GNULIB_POSIXCHECK |
| 349 |
# undef mkostemp |
| 350 |
# if HAVE_RAW_DECL_MKOSTEMP |
| 351 |
_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " |
| 352 |
"use gnulib module mkostemp for portability"); |
| 353 |
# endif |
| 354 |
#endif |
| 355 |
|
| 356 |
#if @GNULIB_MKOSTEMPS@ |
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
# if !@HAVE_MKOSTEMPS@ |
| 371 |
_GL_FUNCDECL_SYS (mkostemps, int, |
| 372 |
(char * , int , int ) |
| 373 |
_GL_ARG_NONNULL ((1))); |
| 374 |
# endif |
| 375 |
_GL_CXXALIAS_SYS (mkostemps, int, |
| 376 |
(char * , int , int )); |
| 377 |
_GL_CXXALIASWARN (mkostemps); |
| 378 |
#elif defined GNULIB_POSIXCHECK |
| 379 |
# undef mkostemps |
| 380 |
# if HAVE_RAW_DECL_MKOSTEMPS |
| 381 |
_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " |
| 382 |
"use gnulib module mkostemps for portability"); |
| 383 |
# endif |
| 384 |
#endif |
| 385 |
|
| 386 |
#if @GNULIB_MKSTEMP@ |
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
# if @REPLACE_MKSTEMP@ |
| 397 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 398 |
# define mkstemp rpl_mkstemp |
| 399 |
# endif |
| 400 |
_GL_FUNCDECL_RPL (mkstemp, int, (char * ) _GL_ARG_NONNULL ((1))); |
| 401 |
_GL_CXXALIAS_RPL (mkstemp, int, (char * )); |
| 402 |
# else |
| 403 |
# if ! @HAVE_MKSTEMP@ |
| 404 |
_GL_FUNCDECL_SYS (mkstemp, int, (char * ) _GL_ARG_NONNULL ((1))); |
| 405 |
# endif |
| 406 |
_GL_CXXALIAS_SYS (mkstemp, int, (char * )); |
| 407 |
# endif |
| 408 |
_GL_CXXALIASWARN (mkstemp); |
| 409 |
#elif defined GNULIB_POSIXCHECK |
| 410 |
# undef mkstemp |
| 411 |
# if HAVE_RAW_DECL_MKSTEMP |
| 412 |
_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " |
| 413 |
"use gnulib module mkstemp for portability"); |
| 414 |
# endif |
| 415 |
#endif |
| 416 |
|
| 417 |
#if @GNULIB_MKSTEMPS@ |
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
# if !@HAVE_MKSTEMPS@ |
| 429 |
_GL_FUNCDECL_SYS (mkstemps, int, (char * , int ) |
| 430 |
_GL_ARG_NONNULL ((1))); |
| 431 |
# endif |
| 432 |
_GL_CXXALIAS_SYS (mkstemps, int, (char * , int )); |
| 433 |
_GL_CXXALIASWARN (mkstemps); |
| 434 |
#elif defined GNULIB_POSIXCHECK |
| 435 |
# undef mkstemps |
| 436 |
# if HAVE_RAW_DECL_MKSTEMPS |
| 437 |
_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " |
| 438 |
"use gnulib module mkstemps for portability"); |
| 439 |
# endif |
| 440 |
#endif |
| 441 |
|
| 442 |
#if @GNULIB_POSIX_OPENPT@ |
| 443 |
|
| 444 |
|
| 445 |
# if !@HAVE_POSIX_OPENPT@ |
| 446 |
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); |
| 447 |
# endif |
| 448 |
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); |
| 449 |
_GL_CXXALIASWARN (posix_openpt); |
| 450 |
#elif defined GNULIB_POSIXCHECK |
| 451 |
# undef posix_openpt |
| 452 |
# if HAVE_RAW_DECL_POSIX_OPENPT |
| 453 |
_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " |
| 454 |
"use gnulib module posix_openpt for portability"); |
| 455 |
# endif |
| 456 |
#endif |
| 457 |
|
| 458 |
#if @GNULIB_PTSNAME@ |
| 459 |
|
| 460 |
|
| 461 |
# if @REPLACE_PTSNAME@ |
| 462 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 463 |
# undef ptsname |
| 464 |
# define ptsname rpl_ptsname |
| 465 |
# endif |
| 466 |
_GL_FUNCDECL_RPL (ptsname, char *, (int fd)); |
| 467 |
_GL_CXXALIAS_RPL (ptsname, char *, (int fd)); |
| 468 |
# else |
| 469 |
# if !@HAVE_PTSNAME@ |
| 470 |
_GL_FUNCDECL_SYS (ptsname, char *, (int fd)); |
| 471 |
# endif |
| 472 |
_GL_CXXALIAS_SYS (ptsname, char *, (int fd)); |
| 473 |
# endif |
| 474 |
_GL_CXXALIASWARN (ptsname); |
| 475 |
#elif defined GNULIB_POSIXCHECK |
| 476 |
# undef ptsname |
| 477 |
# if HAVE_RAW_DECL_PTSNAME |
| 478 |
_GL_WARN_ON_USE (ptsname, "ptsname is not portable - " |
| 479 |
"use gnulib module ptsname for portability"); |
| 480 |
# endif |
| 481 |
#endif |
| 482 |
|
| 483 |
#if @GNULIB_PTSNAME_R@ |
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
# if @REPLACE_PTSNAME_R@ |
| 488 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 489 |
# undef ptsname_r |
| 490 |
# define ptsname_r rpl_ptsname_r |
| 491 |
# endif |
| 492 |
_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); |
| 493 |
_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); |
| 494 |
# else |
| 495 |
# if !@HAVE_PTSNAME_R@ |
| 496 |
_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); |
| 497 |
# endif |
| 498 |
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); |
| 499 |
# endif |
| 500 |
_GL_CXXALIASWARN (ptsname_r); |
| 501 |
#elif defined GNULIB_POSIXCHECK |
| 502 |
# undef ptsname_r |
| 503 |
# if HAVE_RAW_DECL_PTSNAME_R |
| 504 |
_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " |
| 505 |
"use gnulib module ptsname_r for portability"); |
| 506 |
# endif |
| 507 |
#endif |
| 508 |
|
| 509 |
#if @GNULIB_PUTENV@ |
| 510 |
# if @REPLACE_PUTENV@ |
| 511 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 512 |
# undef putenv |
| 513 |
# define putenv rpl_putenv |
| 514 |
# endif |
| 515 |
_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); |
| 516 |
_GL_CXXALIAS_RPL (putenv, int, (char *string)); |
| 517 |
# else |
| 518 |
_GL_CXXALIAS_SYS (putenv, int, (char *string)); |
| 519 |
# endif |
| 520 |
_GL_CXXALIASWARN (putenv); |
| 521 |
#endif |
| 522 |
|
| 523 |
|
| 524 |
#if @GNULIB_RANDOM_R@ |
| 525 |
# if !@HAVE_RANDOM_R@ |
| 526 |
# ifndef RAND_MAX |
| 527 |
# define RAND_MAX 2147483647 |
| 528 |
# endif |
| 529 |
# endif |
| 530 |
#endif |
| 531 |
|
| 532 |
|
| 533 |
#if @GNULIB_RANDOM@ |
| 534 |
# if !@HAVE_RANDOM@ |
| 535 |
_GL_FUNCDECL_SYS (random, long, (void)); |
| 536 |
# endif |
| 537 |
_GL_CXXALIAS_SYS (random, long, (void)); |
| 538 |
_GL_CXXALIASWARN (random); |
| 539 |
#elif defined GNULIB_POSIXCHECK |
| 540 |
# undef random |
| 541 |
# if HAVE_RAW_DECL_RANDOM |
| 542 |
_GL_WARN_ON_USE (random, "random is unportable - " |
| 543 |
"use gnulib module random for portability"); |
| 544 |
# endif |
| 545 |
#endif |
| 546 |
|
| 547 |
#if @GNULIB_RANDOM@ |
| 548 |
# if !@HAVE_RANDOM@ |
| 549 |
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); |
| 550 |
# endif |
| 551 |
_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed)); |
| 552 |
_GL_CXXALIASWARN (srandom); |
| 553 |
#elif defined GNULIB_POSIXCHECK |
| 554 |
# undef srandom |
| 555 |
# if HAVE_RAW_DECL_SRANDOM |
| 556 |
_GL_WARN_ON_USE (srandom, "srandom is unportable - " |
| 557 |
"use gnulib module random for portability"); |
| 558 |
# endif |
| 559 |
#endif |
| 560 |
|
| 561 |
#if @GNULIB_RANDOM@ |
| 562 |
# if !@HAVE_RANDOM@ |
| 563 |
_GL_FUNCDECL_SYS (initstate, char *, |
| 564 |
(unsigned int seed, char *buf, size_t buf_size) |
| 565 |
_GL_ARG_NONNULL ((2))); |
| 566 |
# endif |
| 567 |
_GL_CXXALIAS_SYS (initstate, char *, |
| 568 |
(unsigned int seed, char *buf, size_t buf_size)); |
| 569 |
_GL_CXXALIASWARN (initstate); |
| 570 |
#elif defined GNULIB_POSIXCHECK |
| 571 |
# undef initstate |
| 572 |
# if HAVE_RAW_DECL_INITSTATE_R |
| 573 |
_GL_WARN_ON_USE (initstate, "initstate is unportable - " |
| 574 |
"use gnulib module random for portability"); |
| 575 |
# endif |
| 576 |
#endif |
| 577 |
|
| 578 |
#if @GNULIB_RANDOM@ |
| 579 |
# if !@HAVE_RANDOM@ |
| 580 |
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); |
| 581 |
# endif |
| 582 |
_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state)); |
| 583 |
_GL_CXXALIASWARN (setstate); |
| 584 |
#elif defined GNULIB_POSIXCHECK |
| 585 |
# undef setstate |
| 586 |
# if HAVE_RAW_DECL_SETSTATE_R |
| 587 |
_GL_WARN_ON_USE (setstate, "setstate is unportable - " |
| 588 |
"use gnulib module random for portability"); |
| 589 |
# endif |
| 590 |
#endif |
| 591 |
|
| 592 |
|
| 593 |
#if @GNULIB_RANDOM_R@ |
| 594 |
# if @REPLACE_RANDOM_R@ |
| 595 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 596 |
# undef random_r |
| 597 |
# define random_r rpl_random_r |
| 598 |
# endif |
| 599 |
_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) |
| 600 |
_GL_ARG_NONNULL ((1, 2))); |
| 601 |
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); |
| 602 |
# else |
| 603 |
# if !@HAVE_RANDOM_R@ |
| 604 |
_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) |
| 605 |
_GL_ARG_NONNULL ((1, 2))); |
| 606 |
# endif |
| 607 |
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); |
| 608 |
# endif |
| 609 |
_GL_CXXALIASWARN (random_r); |
| 610 |
#elif defined GNULIB_POSIXCHECK |
| 611 |
# undef random_r |
| 612 |
# if HAVE_RAW_DECL_RANDOM_R |
| 613 |
_GL_WARN_ON_USE (random_r, "random_r is unportable - " |
| 614 |
"use gnulib module random_r for portability"); |
| 615 |
# endif |
| 616 |
#endif |
| 617 |
|
| 618 |
#if @GNULIB_RANDOM_R@ |
| 619 |
# if @REPLACE_RANDOM_R@ |
| 620 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 621 |
# undef srandom_r |
| 622 |
# define srandom_r rpl_srandom_r |
| 623 |
# endif |
| 624 |
_GL_FUNCDECL_RPL (srandom_r, int, |
| 625 |
(unsigned int seed, struct random_data *rand_state) |
| 626 |
_GL_ARG_NONNULL ((2))); |
| 627 |
_GL_CXXALIAS_RPL (srandom_r, int, |
| 628 |
(unsigned int seed, struct random_data *rand_state)); |
| 629 |
# else |
| 630 |
# if !@HAVE_RANDOM_R@ |
| 631 |
_GL_FUNCDECL_SYS (srandom_r, int, |
| 632 |
(unsigned int seed, struct random_data *rand_state) |
| 633 |
_GL_ARG_NONNULL ((2))); |
| 634 |
# endif |
| 635 |
_GL_CXXALIAS_SYS (srandom_r, int, |
| 636 |
(unsigned int seed, struct random_data *rand_state)); |
| 637 |
# endif |
| 638 |
_GL_CXXALIASWARN (srandom_r); |
| 639 |
#elif defined GNULIB_POSIXCHECK |
| 640 |
# undef srandom_r |
| 641 |
# if HAVE_RAW_DECL_SRANDOM_R |
| 642 |
_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " |
| 643 |
"use gnulib module random_r for portability"); |
| 644 |
# endif |
| 645 |
#endif |
| 646 |
|
| 647 |
#if @GNULIB_RANDOM_R@ |
| 648 |
# if @REPLACE_RANDOM_R@ |
| 649 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 650 |
# undef initstate_r |
| 651 |
# define initstate_r rpl_initstate_r |
| 652 |
# endif |
| 653 |
_GL_FUNCDECL_RPL (initstate_r, int, |
| 654 |
(unsigned int seed, char *buf, size_t buf_size, |
| 655 |
struct random_data *rand_state) |
| 656 |
_GL_ARG_NONNULL ((2, 4))); |
| 657 |
_GL_CXXALIAS_RPL (initstate_r, int, |
| 658 |
(unsigned int seed, char *buf, size_t buf_size, |
| 659 |
struct random_data *rand_state)); |
| 660 |
# else |
| 661 |
# if !@HAVE_RANDOM_R@ |
| 662 |
_GL_FUNCDECL_SYS (initstate_r, int, |
| 663 |
(unsigned int seed, char *buf, size_t buf_size, |
| 664 |
struct random_data *rand_state) |
| 665 |
_GL_ARG_NONNULL ((2, 4))); |
| 666 |
# endif |
| 667 |
_GL_CXXALIAS_SYS (initstate_r, int, |
| 668 |
(unsigned int seed, char *buf, size_t buf_size, |
| 669 |
struct random_data *rand_state)); |
| 670 |
# endif |
| 671 |
_GL_CXXALIASWARN (initstate_r); |
| 672 |
#elif defined GNULIB_POSIXCHECK |
| 673 |
# undef initstate_r |
| 674 |
# if HAVE_RAW_DECL_INITSTATE_R |
| 675 |
_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " |
| 676 |
"use gnulib module random_r for portability"); |
| 677 |
# endif |
| 678 |
#endif |
| 679 |
|
| 680 |
#if @GNULIB_RANDOM_R@ |
| 681 |
# if @REPLACE_RANDOM_R@ |
| 682 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 683 |
# undef setstate_r |
| 684 |
# define setstate_r rpl_setstate_r |
| 685 |
# endif |
| 686 |
_GL_FUNCDECL_RPL (setstate_r, int, |
| 687 |
(char *arg_state, struct random_data *rand_state) |
| 688 |
_GL_ARG_NONNULL ((1, 2))); |
| 689 |
_GL_CXXALIAS_RPL (setstate_r, int, |
| 690 |
(char *arg_state, struct random_data *rand_state)); |
| 691 |
# else |
| 692 |
# if !@HAVE_RANDOM_R@ |
| 693 |
_GL_FUNCDECL_SYS (setstate_r, int, |
| 694 |
(char *arg_state, struct random_data *rand_state) |
| 695 |
_GL_ARG_NONNULL ((1, 2))); |
| 696 |
# endif |
| 697 |
_GL_CXXALIAS_SYS (setstate_r, int, |
| 698 |
(char *arg_state, struct random_data *rand_state)); |
| 699 |
# endif |
| 700 |
_GL_CXXALIASWARN (setstate_r); |
| 701 |
#elif defined GNULIB_POSIXCHECK |
| 702 |
# undef setstate_r |
| 703 |
# if HAVE_RAW_DECL_SETSTATE_R |
| 704 |
_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " |
| 705 |
"use gnulib module random_r for portability"); |
| 706 |
# endif |
| 707 |
#endif |
| 708 |
|
| 709 |
|
| 710 |
#if @GNULIB_REALLOC_POSIX@ |
| 711 |
# if @REPLACE_REALLOC@ |
| 712 |
# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ |
| 713 |
|| _GL_USE_STDLIB_ALLOC) |
| 714 |
# undef realloc |
| 715 |
# define realloc rpl_realloc |
| 716 |
# endif |
| 717 |
_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)); |
| 718 |
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size)); |
| 719 |
# else |
| 720 |
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); |
| 721 |
# endif |
| 722 |
_GL_CXXALIASWARN (realloc); |
| 723 |
#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC |
| 724 |
# undef realloc |
| 725 |
|
| 726 |
_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " |
| 727 |
"use gnulib module realloc-posix for portability"); |
| 728 |
#endif |
| 729 |
|
| 730 |
#if @GNULIB_REALPATH@ |
| 731 |
# if @REPLACE_REALPATH@ |
| 732 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 733 |
# define realpath rpl_realpath |
| 734 |
# endif |
| 735 |
_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved) |
| 736 |
_GL_ARG_NONNULL ((1))); |
| 737 |
_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved)); |
| 738 |
# else |
| 739 |
# if !@HAVE_REALPATH@ |
| 740 |
_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved) |
| 741 |
_GL_ARG_NONNULL ((1))); |
| 742 |
# endif |
| 743 |
_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved)); |
| 744 |
# endif |
| 745 |
_GL_CXXALIASWARN (realpath); |
| 746 |
#elif defined GNULIB_POSIXCHECK |
| 747 |
# undef realpath |
| 748 |
# if HAVE_RAW_DECL_REALPATH |
| 749 |
_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " |
| 750 |
"canonicalize or canonicalize-lgpl for portability"); |
| 751 |
# endif |
| 752 |
#endif |
| 753 |
|
| 754 |
#if @GNULIB_RPMATCH@ |
| 755 |
|
| 756 |
|
| 757 |
# if !@HAVE_RPMATCH@ |
| 758 |
_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1))); |
| 759 |
# endif |
| 760 |
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); |
| 761 |
_GL_CXXALIASWARN (rpmatch); |
| 762 |
#elif defined GNULIB_POSIXCHECK |
| 763 |
# undef rpmatch |
| 764 |
# if HAVE_RAW_DECL_RPMATCH |
| 765 |
_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " |
| 766 |
"use gnulib module rpmatch for portability"); |
| 767 |
# endif |
| 768 |
#endif |
| 769 |
|
| 770 |
#if @GNULIB_SECURE_GETENV@ |
| 771 |
|
| 772 |
# if !@HAVE_SECURE_GETENV@ |
| 773 |
_GL_FUNCDECL_SYS (secure_getenv, char *, |
| 774 |
(char const *name) _GL_ARG_NONNULL ((1))); |
| 775 |
# endif |
| 776 |
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); |
| 777 |
_GL_CXXALIASWARN (secure_getenv); |
| 778 |
#elif defined GNULIB_POSIXCHECK |
| 779 |
# undef secure_getenv |
| 780 |
# if HAVE_RAW_DECL_SECURE_GETENV |
| 781 |
_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " |
| 782 |
"use gnulib module secure_getenv for portability"); |
| 783 |
# endif |
| 784 |
#endif |
| 785 |
|
| 786 |
#if @GNULIB_SETENV@ |
| 787 |
|
| 788 |
|
| 789 |
# if @REPLACE_SETENV@ |
| 790 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 791 |
# undef setenv |
| 792 |
# define setenv rpl_setenv |
| 793 |
# endif |
| 794 |
_GL_FUNCDECL_RPL (setenv, int, |
| 795 |
(const char *name, const char *value, int replace) |
| 796 |
_GL_ARG_NONNULL ((1))); |
| 797 |
_GL_CXXALIAS_RPL (setenv, int, |
| 798 |
(const char *name, const char *value, int replace)); |
| 799 |
# else |
| 800 |
# if !@HAVE_DECL_SETENV@ |
| 801 |
_GL_FUNCDECL_SYS (setenv, int, |
| 802 |
(const char *name, const char *value, int replace) |
| 803 |
_GL_ARG_NONNULL ((1))); |
| 804 |
# endif |
| 805 |
_GL_CXXALIAS_SYS (setenv, int, |
| 806 |
(const char *name, const char *value, int replace)); |
| 807 |
# endif |
| 808 |
# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@) |
| 809 |
_GL_CXXALIASWARN (setenv); |
| 810 |
# endif |
| 811 |
#elif defined GNULIB_POSIXCHECK |
| 812 |
# undef setenv |
| 813 |
# if HAVE_RAW_DECL_SETENV |
| 814 |
_GL_WARN_ON_USE (setenv, "setenv is unportable - " |
| 815 |
"use gnulib module setenv for portability"); |
| 816 |
# endif |
| 817 |
#endif |
| 818 |
|
| 819 |
#if @GNULIB_STRTOD@ |
| 820 |
|
| 821 |
# if @REPLACE_STRTOD@ |
| 822 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 823 |
# define strtod rpl_strtod |
| 824 |
# endif |
| 825 |
_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) |
| 826 |
_GL_ARG_NONNULL ((1))); |
| 827 |
_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); |
| 828 |
# else |
| 829 |
# if !@HAVE_STRTOD@ |
| 830 |
_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp) |
| 831 |
_GL_ARG_NONNULL ((1))); |
| 832 |
# endif |
| 833 |
_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp)); |
| 834 |
# endif |
| 835 |
_GL_CXXALIASWARN (strtod); |
| 836 |
#elif defined GNULIB_POSIXCHECK |
| 837 |
# undef strtod |
| 838 |
# if HAVE_RAW_DECL_STRTOD |
| 839 |
_GL_WARN_ON_USE (strtod, "strtod is unportable - " |
| 840 |
"use gnulib module strtod for portability"); |
| 841 |
# endif |
| 842 |
#endif |
| 843 |
|
| 844 |
#if @GNULIB_STRTOLL@ |
| 845 |
|
| 846 |
|
| 847 |
|
| 848 |
|
| 849 |
|
| 850 |
|
| 851 |
|
| 852 |
|
| 853 |
# if !@HAVE_STRTOLL@ |
| 854 |
_GL_FUNCDECL_SYS (strtoll, long long, |
| 855 |
(const char *string, char **endptr, int base) |
| 856 |
_GL_ARG_NONNULL ((1))); |
| 857 |
# endif |
| 858 |
_GL_CXXALIAS_SYS (strtoll, long long, |
| 859 |
(const char *string, char **endptr, int base)); |
| 860 |
_GL_CXXALIASWARN (strtoll); |
| 861 |
#elif defined GNULIB_POSIXCHECK |
| 862 |
# undef strtoll |
| 863 |
# if HAVE_RAW_DECL_STRTOLL |
| 864 |
_GL_WARN_ON_USE (strtoll, "strtoll is unportable - " |
| 865 |
"use gnulib module strtoll for portability"); |
| 866 |
# endif |
| 867 |
#endif |
| 868 |
|
| 869 |
#if @GNULIB_STRTOULL@ |
| 870 |
|
| 871 |
|
| 872 |
|
| 873 |
|
| 874 |
|
| 875 |
|
| 876 |
|
| 877 |
|
| 878 |
# if !@HAVE_STRTOULL@ |
| 879 |
_GL_FUNCDECL_SYS (strtoull, unsigned long long, |
| 880 |
(const char *string, char **endptr, int base) |
| 881 |
_GL_ARG_NONNULL ((1))); |
| 882 |
# endif |
| 883 |
_GL_CXXALIAS_SYS (strtoull, unsigned long long, |
| 884 |
(const char *string, char **endptr, int base)); |
| 885 |
_GL_CXXALIASWARN (strtoull); |
| 886 |
#elif defined GNULIB_POSIXCHECK |
| 887 |
# undef strtoull |
| 888 |
# if HAVE_RAW_DECL_STRTOULL |
| 889 |
_GL_WARN_ON_USE (strtoull, "strtoull is unportable - " |
| 890 |
"use gnulib module strtoull for portability"); |
| 891 |
# endif |
| 892 |
#endif |
| 893 |
|
| 894 |
#if @GNULIB_UNLOCKPT@ |
| 895 |
|
| 896 |
|
| 897 |
# if !@HAVE_UNLOCKPT@ |
| 898 |
_GL_FUNCDECL_SYS (unlockpt, int, (int fd)); |
| 899 |
# endif |
| 900 |
_GL_CXXALIAS_SYS (unlockpt, int, (int fd)); |
| 901 |
_GL_CXXALIASWARN (unlockpt); |
| 902 |
#elif defined GNULIB_POSIXCHECK |
| 903 |
# undef unlockpt |
| 904 |
# if HAVE_RAW_DECL_UNLOCKPT |
| 905 |
_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " |
| 906 |
"use gnulib module unlockpt for portability"); |
| 907 |
# endif |
| 908 |
#endif |
| 909 |
|
| 910 |
#if @GNULIB_UNSETENV@ |
| 911 |
|
| 912 |
# if @REPLACE_UNSETENV@ |
| 913 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 914 |
# undef unsetenv |
| 915 |
# define unsetenv rpl_unsetenv |
| 916 |
# endif |
| 917 |
_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); |
| 918 |
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); |
| 919 |
# else |
| 920 |
# if !@HAVE_DECL_UNSETENV@ |
| 921 |
_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); |
| 922 |
# endif |
| 923 |
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); |
| 924 |
# endif |
| 925 |
# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@) |
| 926 |
_GL_CXXALIASWARN (unsetenv); |
| 927 |
# endif |
| 928 |
#elif defined GNULIB_POSIXCHECK |
| 929 |
# undef unsetenv |
| 930 |
# if HAVE_RAW_DECL_UNSETENV |
| 931 |
_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " |
| 932 |
"use gnulib module unsetenv for portability"); |
| 933 |
# endif |
| 934 |
#endif |
| 935 |
|
| 936 |
|
| 937 |
#if @GNULIB_WCTOMB@ |
| 938 |
# if @REPLACE_WCTOMB@ |
| 939 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 940 |
# undef wctomb |
| 941 |
# define wctomb rpl_wctomb |
| 942 |
# endif |
| 943 |
_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); |
| 944 |
_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); |
| 945 |
# else |
| 946 |
_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); |
| 947 |
# endif |
| 948 |
_GL_CXXALIASWARN (wctomb); |
| 949 |
#endif |
| 950 |
|
| 951 |
|
| 952 |
#endif |
| 953 |
#endif |
| 954 |
#endif |