84
89
#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
85
/* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
86
/* On MacOS X 10.5, only <unistd.h> declares mkstemps. */
90
/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
91
/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
87
92
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
88
93
/* But avoid namespace pollution on glibc systems and native Windows. */
89
94
# include <unistd.h>
97
/* The __attribute__ feature is available in gcc versions 2.5 and later.
98
The attribute __pure__ was added in gcc 2.96. */
99
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
100
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
102
# define _GL_ATTRIBUTE_PURE /* empty */
92
105
/* The definition of _Noreturn is copied here. */
94
107
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
133
146
/* Parse a signed decimal integer.
134
147
Returns the value of the integer. Errors are not detected. */
135
148
# if !@HAVE_ATOLL@
136
_GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
149
_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
151
_GL_ARG_NONNULL ((1)));
138
153
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
139
154
_GL_CXXALIASWARN (atoll);
441
#if @GNULIB_POSIX_OPENPT@
442
/* Return an FD open to the master side of a pseudo-terminal. Flags should
443
include O_RDWR, and may also include O_NOCTTY. */
444
# if !@HAVE_POSIX_OPENPT@
445
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
447
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
448
_GL_CXXALIASWARN (posix_openpt);
449
#elif defined GNULIB_POSIXCHECK
451
# if HAVE_RAW_DECL_POSIX_OPENPT
452
_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
453
"use gnulib module posix_openpt for portability");
426
457
#if @GNULIB_PTSNAME@
427
458
/* Return the pathname of the pseudo-terminal slave associated with
428
459
the master FD is open on, or NULL on errors. */
460
# if @REPLACE_PTSNAME@
461
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
463
# define ptsname rpl_ptsname
465
_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
466
_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
430
469
_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
432
471
_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
433
473
_GL_CXXALIASWARN (ptsname);
434
474
#elif defined GNULIB_POSIXCHECK
482
#if @GNULIB_PTSNAME_R@
483
/* Set the pathname of the pseudo-terminal slave associated with
484
the master FD is open on and return 0, or set errno and return
485
non-zero on errors. */
486
# if @REPLACE_PTSNAME_R@
487
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
489
# define ptsname_r rpl_ptsname_r
491
_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
492
_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
494
# if !@HAVE_PTSNAME_R@
495
_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
497
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
499
_GL_CXXALIASWARN (ptsname_r);
500
#elif defined GNULIB_POSIXCHECK
502
# if HAVE_RAW_DECL_PTSNAME_R
503
_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
504
"use gnulib module ptsname_r for portability");
442
508
#if @GNULIB_PUTENV@
443
509
# if @REPLACE_PUTENV@
444
510
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
534
_GL_FUNCDECL_SYS (random, long, (void));
536
_GL_CXXALIAS_SYS (random, long, (void));
537
_GL_CXXALIASWARN (random);
538
#elif defined GNULIB_POSIXCHECK
540
# if HAVE_RAW_DECL_RANDOM
541
_GL_WARN_ON_USE (random, "random is unportable - "
542
"use gnulib module random for portability");
548
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
550
_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
551
_GL_CXXALIASWARN (srandom);
552
#elif defined GNULIB_POSIXCHECK
554
# if HAVE_RAW_DECL_SRANDOM
555
_GL_WARN_ON_USE (srandom, "srandom is unportable - "
556
"use gnulib module random for portability");
562
_GL_FUNCDECL_SYS (initstate, char *,
563
(unsigned int seed, char *buf, size_t buf_size)
564
_GL_ARG_NONNULL ((2)));
566
_GL_CXXALIAS_SYS (initstate, char *,
567
(unsigned int seed, char *buf, size_t buf_size));
568
_GL_CXXALIASWARN (initstate);
569
#elif defined GNULIB_POSIXCHECK
571
# if HAVE_RAW_DECL_INITSTATE_R
572
_GL_WARN_ON_USE (initstate, "initstate is unportable - "
573
"use gnulib module random for portability");
579
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
581
_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
582
_GL_CXXALIASWARN (setstate);
583
#elif defined GNULIB_POSIXCHECK
585
# if HAVE_RAW_DECL_SETSTATE_R
586
_GL_WARN_ON_USE (setstate, "setstate is unportable - "
587
"use gnulib module random for portability");
465
592
#if @GNULIB_RANDOM_R@
466
# if !@HAVE_RANDOM_R@
593
# if @REPLACE_RANDOM_R@
594
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
596
# define random_r rpl_random_r
598
_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
599
_GL_ARG_NONNULL ((1, 2)));
600
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
602
# if !@HAVE_RANDOM_R@
467
603
_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
468
604
_GL_ARG_NONNULL ((1, 2)));
470
606
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
471
608
_GL_CXXALIASWARN (random_r);
472
609
#elif defined GNULIB_POSIXCHECK
480
617
#if @GNULIB_RANDOM_R@
481
# if !@HAVE_RANDOM_R@
618
# if @REPLACE_RANDOM_R@
619
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
621
# define srandom_r rpl_srandom_r
623
_GL_FUNCDECL_RPL (srandom_r, int,
624
(unsigned int seed, struct random_data *rand_state)
625
_GL_ARG_NONNULL ((2)));
626
_GL_CXXALIAS_RPL (srandom_r, int,
627
(unsigned int seed, struct random_data *rand_state));
629
# if !@HAVE_RANDOM_R@
482
630
_GL_FUNCDECL_SYS (srandom_r, int,
483
631
(unsigned int seed, struct random_data *rand_state)
484
632
_GL_ARG_NONNULL ((2)));
486
634
_GL_CXXALIAS_SYS (srandom_r, int,
487
635
(unsigned int seed, struct random_data *rand_state));
488
637
_GL_CXXALIASWARN (srandom_r);
489
638
#elif defined GNULIB_POSIXCHECK
490
639
# undef srandom_r
497
646
#if @GNULIB_RANDOM_R@
498
# if !@HAVE_RANDOM_R@
647
# if @REPLACE_RANDOM_R@
648
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
650
# define initstate_r rpl_initstate_r
652
_GL_FUNCDECL_RPL (initstate_r, int,
653
(unsigned int seed, char *buf, size_t buf_size,
654
struct random_data *rand_state)
655
_GL_ARG_NONNULL ((2, 4)));
656
_GL_CXXALIAS_RPL (initstate_r, int,
657
(unsigned int seed, char *buf, size_t buf_size,
658
struct random_data *rand_state));
660
# if !@HAVE_RANDOM_R@
499
661
_GL_FUNCDECL_SYS (initstate_r, int,
500
662
(unsigned int seed, char *buf, size_t buf_size,
501
663
struct random_data *rand_state)
502
664
_GL_ARG_NONNULL ((2, 4)));
504
666
_GL_CXXALIAS_SYS (initstate_r, int,
505
667
(unsigned int seed, char *buf, size_t buf_size,
506
668
struct random_data *rand_state));
507
670
_GL_CXXALIASWARN (initstate_r);
508
671
#elif defined GNULIB_POSIXCHECK
509
672
# undef initstate_r
516
679
#if @GNULIB_RANDOM_R@
517
# if !@HAVE_RANDOM_R@
680
# if @REPLACE_RANDOM_R@
681
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
683
# define setstate_r rpl_setstate_r
685
_GL_FUNCDECL_RPL (setstate_r, int,
686
(char *arg_state, struct random_data *rand_state)
687
_GL_ARG_NONNULL ((1, 2)));
688
_GL_CXXALIAS_RPL (setstate_r, int,
689
(char *arg_state, struct random_data *rand_state));
691
# if !@HAVE_RANDOM_R@
518
692
_GL_FUNCDECL_SYS (setstate_r, int,
519
693
(char *arg_state, struct random_data *rand_state)
520
694
_GL_ARG_NONNULL ((1, 2)));
522
696
_GL_CXXALIAS_SYS (setstate_r, int,
523
697
(char *arg_state, struct random_data *rand_state));
524
699
_GL_CXXALIASWARN (setstate_r);
525
700
#elif defined GNULIB_POSIXCHECK
526
701
# undef setstate_r