~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/stdlib.in.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* A GNU-like <stdlib.h>.
2
2
 
3
 
   Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc.
 
3
   Copyright (C) 1995, 2001-2004, 2006-2012 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software: you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
49
49
# include <sys/loadavg.h>
50
50
#endif
51
51
 
 
52
/* Native Windows platforms declare mktemp() in <io.h>.  */
 
53
#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
 
54
# include <io.h>
 
55
#endif
 
56
 
52
57
#if @GNULIB_RANDOM_R@
53
58
 
54
59
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
58
63
#  include <random.h>
59
64
# endif
60
65
 
61
 
# if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@
 
66
# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
62
67
#  include <stdint.h>
63
68
# endif
64
69
 
82
87
#endif
83
88
 
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>
90
95
#endif
91
96
 
 
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__))
 
101
#else
 
102
# define _GL_ATTRIBUTE_PURE /* empty */
 
103
#endif
 
104
 
92
105
/* The definition of _Noreturn is copied here.  */
93
106
 
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)
 
150
                                    _GL_ATTRIBUTE_PURE
 
151
                                    _GL_ARG_NONNULL ((1)));
137
152
# endif
138
153
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
139
154
_GL_CXXALIASWARN (atoll);
247
262
#elif defined GNULIB_POSIXCHECK
248
263
# undef grantpt
249
264
# if HAVE_RAW_DECL_GRANTPT
250
 
_GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
 
265
_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
251
266
                 "use gnulib module grantpt for portability");
252
267
# endif
253
268
#endif
423
438
# endif
424
439
#endif
425
440
 
 
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));
 
446
# endif
 
447
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
 
448
_GL_CXXALIASWARN (posix_openpt);
 
449
#elif defined GNULIB_POSIXCHECK
 
450
# undef posix_openpt
 
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");
 
454
# endif
 
455
#endif
 
456
 
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.  */
429
 
# if !@HAVE_PTSNAME@
 
460
# if @REPLACE_PTSNAME@
 
461
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
462
#   undef ptsname
 
463
#   define ptsname rpl_ptsname
 
464
#  endif
 
465
_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
 
466
_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
 
467
# else
 
468
#  if !@HAVE_PTSNAME@
430
469
_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
431
 
# endif
 
470
#  endif
432
471
_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
 
472
# endif
433
473
_GL_CXXALIASWARN (ptsname);
434
474
#elif defined GNULIB_POSIXCHECK
435
475
# undef ptsname
439
479
# endif
440
480
#endif
441
481
 
 
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)
 
488
#   undef ptsname_r
 
489
#   define ptsname_r rpl_ptsname_r
 
490
#  endif
 
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));
 
493
# else
 
494
#  if !@HAVE_PTSNAME_R@
 
495
_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
 
496
#  endif
 
497
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
 
498
# endif
 
499
_GL_CXXALIASWARN (ptsname_r);
 
500
#elif defined GNULIB_POSIXCHECK
 
501
# undef ptsname_r
 
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");
 
505
# endif
 
506
#endif
 
507
 
442
508
#if @GNULIB_PUTENV@
443
509
# if @REPLACE_PUTENV@
444
510
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
462
528
# endif
463
529
#endif
464
530
 
 
531
 
 
532
#if @GNULIB_RANDOM@
 
533
# if !@HAVE_RANDOM@
 
534
_GL_FUNCDECL_SYS (random, long, (void));
 
535
# endif
 
536
_GL_CXXALIAS_SYS (random, long, (void));
 
537
_GL_CXXALIASWARN (random);
 
538
#elif defined GNULIB_POSIXCHECK
 
539
# undef random
 
540
# if HAVE_RAW_DECL_RANDOM
 
541
_GL_WARN_ON_USE (random, "random is unportable - "
 
542
                 "use gnulib module random for portability");
 
543
# endif
 
544
#endif
 
545
 
 
546
#if @GNULIB_RANDOM@
 
547
# if !@HAVE_RANDOM@
 
548
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
 
549
# endif
 
550
_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
 
551
_GL_CXXALIASWARN (srandom);
 
552
#elif defined GNULIB_POSIXCHECK
 
553
# undef srandom
 
554
# if HAVE_RAW_DECL_SRANDOM
 
555
_GL_WARN_ON_USE (srandom, "srandom is unportable - "
 
556
                 "use gnulib module random for portability");
 
557
# endif
 
558
#endif
 
559
 
 
560
#if @GNULIB_RANDOM@
 
561
# if !@HAVE_RANDOM@
 
562
_GL_FUNCDECL_SYS (initstate, char *,
 
563
                  (unsigned int seed, char *buf, size_t buf_size)
 
564
                  _GL_ARG_NONNULL ((2)));
 
565
# endif
 
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
 
570
# undef initstate
 
571
# if HAVE_RAW_DECL_INITSTATE_R
 
572
_GL_WARN_ON_USE (initstate, "initstate is unportable - "
 
573
                 "use gnulib module random for portability");
 
574
# endif
 
575
#endif
 
576
 
 
577
#if @GNULIB_RANDOM@
 
578
# if !@HAVE_RANDOM@
 
579
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
 
580
# endif
 
581
_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
 
582
_GL_CXXALIASWARN (setstate);
 
583
#elif defined GNULIB_POSIXCHECK
 
584
# undef setstate
 
585
# if HAVE_RAW_DECL_SETSTATE_R
 
586
_GL_WARN_ON_USE (setstate, "setstate is unportable - "
 
587
                 "use gnulib module random for portability");
 
588
# endif
 
589
#endif
 
590
 
 
591
 
465
592
#if @GNULIB_RANDOM_R@
466
 
# if !@HAVE_RANDOM_R@
 
593
# if @REPLACE_RANDOM_R@
 
594
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
595
#   undef random_r
 
596
#   define random_r rpl_random_r
 
597
#  endif
 
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));
 
601
# else
 
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)));
469
 
# endif
 
605
#  endif
470
606
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
 
607
# endif
471
608
_GL_CXXALIASWARN (random_r);
472
609
#elif defined GNULIB_POSIXCHECK
473
610
# undef random_r
478
615
#endif
479
616
 
480
617
#if @GNULIB_RANDOM_R@
481
 
# if !@HAVE_RANDOM_R@
 
618
# if @REPLACE_RANDOM_R@
 
619
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
620
#   undef srandom_r
 
621
#   define srandom_r rpl_srandom_r
 
622
#  endif
 
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));
 
628
# else
 
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)));
485
 
# endif
 
633
#  endif
486
634
_GL_CXXALIAS_SYS (srandom_r, int,
487
635
                  (unsigned int seed, struct random_data *rand_state));
 
636
# endif
488
637
_GL_CXXALIASWARN (srandom_r);
489
638
#elif defined GNULIB_POSIXCHECK
490
639
# undef srandom_r
495
644
#endif
496
645
 
497
646
#if @GNULIB_RANDOM_R@
498
 
# if !@HAVE_RANDOM_R@
 
647
# if @REPLACE_RANDOM_R@
 
648
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
649
#   undef initstate_r
 
650
#   define initstate_r rpl_initstate_r
 
651
#  endif
 
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));
 
659
# else
 
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)));
503
 
# endif
 
665
#  endif
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));
 
669
# endif
507
670
_GL_CXXALIASWARN (initstate_r);
508
671
#elif defined GNULIB_POSIXCHECK
509
672
# undef initstate_r
514
677
#endif
515
678
 
516
679
#if @GNULIB_RANDOM_R@
517
 
# if !@HAVE_RANDOM_R@
 
680
# if @REPLACE_RANDOM_R@
 
681
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
682
#   undef setstate_r
 
683
#   define setstate_r rpl_setstate_r
 
684
#  endif
 
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));
 
690
# else
 
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)));
521
 
# endif
 
695
#  endif
522
696
_GL_CXXALIAS_SYS (setstate_r, int,
523
697
                  (char *arg_state, struct random_data *rand_state));
 
698
# endif
524
699
_GL_CXXALIASWARN (setstate_r);
525
700
#elif defined GNULIB_POSIXCHECK
526
701
# undef setstate_r