Mercurial > gnulib
annotate lib/stdlib.in.h @ 40173:b716418da8b9
c-strtod, c-strtold: Use the bug fixes for strtod, strtold.
* lib/stdlib.in.h (GNULIB_defined_strtod_function,
GNULIB_defined_strtold_function): New macros.
* lib/c-strtod.c (HAVE_GOOD_STRTOD_L): New macro.
(STRTOD): Ignore HAVE_C99_STRTOLD.
(c_locale): Don't define it on platforms where strtod_l/strtold_l is
deemed buggy. But do use it on platforms where uselocale exists and is
usable.
(C_STRTOD): Don't use STRTOD_L on platforms where strtod_l/strtold_l is
deemed buggy. On platforms where uselocale exists and is usable, use
uselocale and strtod/strtold.
* m4/c-strtod.m4 (gl_C99_STRTOLD): Remove macro.
(gl_C_STRTOD): Require gt_FUNC_USELOCALE.
(gl_C_STRTOLD): Likewise. Define HAVE_C99_STRTOLD unconditionally.
* modules/c-strtod (Files): Add m4/intl-thread-locale.m4.
(Depends-on): Add strtod.
* modules/c-strtold (Files): Add m4/intl-thread-locale.m4.
(Depends-on): Add strtold.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 01 Feb 2019 04:34:37 +0100 |
parents | cdb3438ceb13 |
children |
rev | line source |
---|---|
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* A GNU-like <stdlib.h>. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
39876
diff
changeset
|
3 Copyright (C) 1995, 2001-2004, 2006-2019 Free Software Foundation, Inc. |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9263
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9263
diff
changeset
|
7 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9263
diff
changeset
|
8 (at your option) any later version. |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 GNU General Public License for more details. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU General Public License |
19190 | 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
18 #if __GNUC__ >= 3 |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
10001
diff
changeset
|
19 @PRAGMA_SYSTEM_HEADER@ |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
20 #endif |
13761
a19ace3ba849
Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents:
13758
diff
changeset
|
21 @PRAGMA_COLUMNS@ |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
10001
diff
changeset
|
22 |
17277
b83fbc95abc4
stdlib: port to Solaris 2.6
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
23 #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc |
b83fbc95abc4
stdlib: port to Solaris 2.6
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
24 /* Special invocation conventions inside some gnulib header files, |
b83fbc95abc4
stdlib: port to Solaris 2.6
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
25 and inside some glibc header files, respectively. */ |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 #else |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 /* Normal invocation convention. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14639
diff
changeset
|
32 #ifndef _@GUARD_PREFIX@_STDLIB_H |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 /* The include_next requires a split double-inclusion guard. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14639
diff
changeset
|
37 #ifndef _@GUARD_PREFIX@_STDLIB_H |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14639
diff
changeset
|
38 #define _@GUARD_PREFIX@_STDLIB_H |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 |
11832
ff3dd373542b
stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents:
11086
diff
changeset
|
40 /* NetBSD 5.0 mis-defines NULL. */ |
ff3dd373542b
stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents:
11086
diff
changeset
|
41 #include <stddef.h> |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
42 |
13683
ddd49c3ebee7
stdlib: clarify MirBSD WEXITSTATUS bug
Bruno Haible <bruno@clisp.org>
parents:
13682
diff
changeset
|
43 /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */ |
13751
0bf7f277a1af
New module 'system-posix'.
Bruno Haible <bruno@clisp.org>
parents:
13693
diff
changeset
|
44 #if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS |
13682
9c6f4459f53d
stdlib: work around MirBSD WEXITSTATUS bug
Eric Blake <eblake@redhat.com>
parents:
13457
diff
changeset
|
45 # include <sys/wait.h> |
9c6f4459f53d
stdlib: work around MirBSD WEXITSTATUS bug
Eric Blake <eblake@redhat.com>
parents:
13457
diff
changeset
|
46 #endif |
9c6f4459f53d
stdlib: work around MirBSD WEXITSTATUS bug
Eric Blake <eblake@redhat.com>
parents:
13457
diff
changeset
|
47 |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
48 /* Solaris declares getloadavg() in <sys/loadavg.h>. */ |
12490
e811ee92408c
Fix typo in today's commit.
Bruno Haible <bruno@clisp.org>
parents:
12488
diff
changeset
|
49 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ |
19525
dbb142f55c27
stdlib: Fix compilation error on OpenIndiana.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
50 /* OpenIndiana has a bug: <sys/time.h> must be included before |
dbb142f55c27
stdlib: Fix compilation error on OpenIndiana.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
51 <sys/loadavg.h>. */ |
dbb142f55c27
stdlib: Fix compilation error on OpenIndiana.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
52 # include <sys/time.h> |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
53 # include <sys/loadavg.h> |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
54 #endif |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
55 |
16284
ab517781f037
Improve support for MSVC 9.
Bruno Haible <bruno@clisp.org>
parents:
16280
diff
changeset
|
56 /* Native Windows platforms declare mktemp() in <io.h>. */ |
19595
beb2ad957aca
Simplify code. Drop support for Borland C++ on Windows.
Bruno Haible <bruno@clisp.org>
parents:
19525
diff
changeset
|
57 #if 0 && (defined _WIN32 && ! defined __CYGWIN__) |
16284
ab517781f037
Improve support for MSVC 9.
Bruno Haible <bruno@clisp.org>
parents:
16280
diff
changeset
|
58 # include <io.h> |
ab517781f037
Improve support for MSVC 9.
Bruno Haible <bruno@clisp.org>
parents:
16280
diff
changeset
|
59 #endif |
ab517781f037
Improve support for MSVC 9.
Bruno Haible <bruno@clisp.org>
parents:
16280
diff
changeset
|
60 |
14315
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
61 #if @GNULIB_RANDOM_R@ |
11086
77f9dee073d2
Avoid redefining 'struct random_data' on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
10975
diff
changeset
|
62 |
14315
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
63 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
64 from <stdlib.h> if _REENTRANT is defined. Include it whenever we need |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
65 'struct random_data'. */ |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
66 # if @HAVE_RANDOM_H@ |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
67 # include <random.h> |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
68 # endif |
10711
e161b51e4184
Use stdint.h, for int32_t.
Simon Josefsson <simon@josefsson.org>
parents:
10704
diff
changeset
|
69 |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
70 # if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@ |
14315
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
71 # include <stdint.h> |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
72 # endif |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
73 |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
74 # if !@HAVE_STRUCT_RANDOM_DATA@ |
13796
f93a5e80c44f
stdlib: Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
13761
diff
changeset
|
75 /* Define 'struct random_data'. |
f93a5e80c44f
stdlib: Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
13761
diff
changeset
|
76 But allow multiple gnulib generated <stdlib.h> replacements to coexist. */ |
14315
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
77 # if !GNULIB_defined_struct_random_data |
10719
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
78 struct random_data |
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
79 { |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
80 int32_t *fptr; /* Front pointer. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
81 int32_t *rptr; /* Rear pointer. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
82 int32_t *state; /* Array of state values. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
83 int rand_type; /* Type of random number generator. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
84 int rand_deg; /* Degree of random number generator. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
85 int rand_sep; /* Distance between front and rear. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
86 int32_t *end_ptr; /* Pointer behind state table. */ |
10719
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
87 }; |
14315
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
88 # define GNULIB_defined_struct_random_data 1 |
27fdb01a2e2e
stdlib: improve random_r modularization
Paul Eggert <eggert@cs.ucla.edu>
parents:
14314
diff
changeset
|
89 # endif |
13796
f93a5e80c44f
stdlib: Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
13761
diff
changeset
|
90 # endif |
10719
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
91 #endif |
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
92 |
39876
1f8e4f117a2b
mkostemp, mkostemps: Fix compilation error in C++ mode on Mac OS X.
Tom Tromey <tom@tromey.com>
parents:
19595
diff
changeset
|
93 #if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__) |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16715
diff
changeset
|
94 /* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */ |
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16715
diff
changeset
|
95 /* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */ |
39876
1f8e4f117a2b
mkostemp, mkostemps: Fix compilation error in C++ mode on Mac OS X.
Tom Tromey <tom@tromey.com>
parents:
19595
diff
changeset
|
96 /* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */ |
12476
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
97 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */ |
13114
6b06dccb9db4
stdlib: Avoid compilation failure of c-strtold on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13030
diff
changeset
|
98 /* But avoid namespace pollution on glibc systems and native Windows. */ |
12476
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
99 # include <unistd.h> |
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
100 #endif |
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
101 |
16715
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
102 /* The __attribute__ feature is available in gcc versions 2.5 and later. |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
103 The attribute __pure__ was added in gcc 2.96. */ |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
104 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
105 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
106 #else |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
107 # define _GL_ATTRIBUTE_PURE /* empty */ |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
108 #endif |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
109 |
15396 | 110 /* The definition of _Noreturn is copied here. */ |
14341
b8a7de52bf47
stdlib: don't get in the way of non-GCC __attribute__
Paul Eggert <eggert@cs.ucla.edu>
parents:
14338
diff
changeset
|
111 |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
112 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
113 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
114 /* The definition of _GL_ARG_NONNULL is copied here. */ |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
115 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
116 /* The definition of _GL_WARN_ON_USE is copied here. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
117 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
118 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
119 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
120 #ifndef EXIT_SUCCESS |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
121 # define EXIT_SUCCESS 0 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
122 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
123 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
124 with proper operation of xargs. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
125 #ifndef EXIT_FAILURE |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
126 # define EXIT_FAILURE 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
127 #elif EXIT_FAILURE != 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
128 # undef EXIT_FAILURE |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
129 # define EXIT_FAILURE 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
130 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
131 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
132 |
13457 | 133 #if @GNULIB__EXIT@ |
134 /* Terminate the current process with the given return code, without running | |
135 the 'atexit' handlers. */ | |
136 # if !@HAVE__EXIT@ | |
15396 | 137 _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); |
13457 | 138 # endif |
139 _GL_CXXALIAS_SYS (_Exit, void, (int status)); | |
140 _GL_CXXALIASWARN (_Exit); | |
141 #elif defined GNULIB_POSIXCHECK | |
142 # undef _Exit | |
143 # if HAVE_RAW_DECL__EXIT | |
144 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " | |
145 "use gnulib module _Exit for portability"); | |
146 # endif | |
147 #endif | |
148 | |
149 | |
11997 | 150 #if @GNULIB_ATOLL@ |
151 /* Parse a signed decimal integer. | |
152 Returns the value of the integer. Errors are not detected. */ | |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
153 # if !@HAVE_ATOLL@ |
16715
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
154 _GL_FUNCDECL_SYS (atoll, long long, (const char *string) |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
155 _GL_ATTRIBUTE_PURE |
be14d9f76493
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16284
diff
changeset
|
156 _GL_ARG_NONNULL ((1))); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
157 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
158 _GL_CXXALIAS_SYS (atoll, long long, (const char *string)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
159 _GL_CXXALIASWARN (atoll); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
160 #elif defined GNULIB_POSIXCHECK |
11997 | 161 # undef atoll |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
162 # if HAVE_RAW_DECL_ATOLL |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
163 _GL_WARN_ON_USE (atoll, "atoll is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
164 "use gnulib module atoll for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
165 # endif |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
166 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
167 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
168 #if @GNULIB_CALLOC_POSIX@ |
13438
425a8899539e
Fix HAVE_CALLOC_POSIX misnomer.
Bruno Haible <bruno@clisp.org>
parents:
13436
diff
changeset
|
169 # if @REPLACE_CALLOC@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
170 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
171 # undef calloc |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
172 # define calloc rpl_calloc |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
173 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
174 _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
175 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
176 # else |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
177 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
178 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
179 _GL_CXXALIASWARN (calloc); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
180 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
181 # undef calloc |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
182 /* Assume calloc is always declared. */ |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
183 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
184 "use gnulib module calloc-posix for portability"); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
185 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
186 |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
187 #if @GNULIB_CANONICALIZE_FILE_NAME@ |
12018
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
188 # if @REPLACE_CANONICALIZE_FILE_NAME@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
189 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
190 # define canonicalize_file_name rpl_canonicalize_file_name |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
191 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
192 _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
193 _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
194 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
195 # else |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
196 # if !@HAVE_CANONICALIZE_FILE_NAME@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
197 _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
198 _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
199 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
200 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); |
12018
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
201 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
202 _GL_CXXALIASWARN (canonicalize_file_name); |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
203 #elif defined GNULIB_POSIXCHECK |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
204 # undef canonicalize_file_name |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
205 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME |
13758
e50f7d9e3040
Avoid some lines longer than 80 characters.
Paul Eggert <eggert@cs.ucla.edu>
parents:
13751
diff
changeset
|
206 _GL_WARN_ON_USE (canonicalize_file_name, |
e50f7d9e3040
Avoid some lines longer than 80 characters.
Paul Eggert <eggert@cs.ucla.edu>
parents:
13751
diff
changeset
|
207 "canonicalize_file_name is unportable - " |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
208 "use gnulib module canonicalize-lgpl for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
209 # endif |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
210 #endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
211 |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
212 #if @GNULIB_GETLOADAVG@ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
213 /* Store max(NELEM,3) load average numbers in LOADAVG[]. |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
214 The three numbers are the load average of the last 1 minute, the last 5 |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
215 minutes, and the last 15 minutes, respectively. |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
216 LOADAVG is an array of NELEM numbers. */ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
217 # if !@HAVE_DECL_GETLOADAVG@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
218 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
219 _GL_ARG_NONNULL ((1))); |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
220 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
221 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
222 _GL_CXXALIASWARN (getloadavg); |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
223 #elif defined GNULIB_POSIXCHECK |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
224 # undef getloadavg |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
225 # if HAVE_RAW_DECL_GETLOADAVG |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
226 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
227 "use gnulib module getloadavg for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
228 # endif |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
229 #endif |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
230 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
231 #if @GNULIB_GETSUBOPT@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
232 /* Assuming *OPTIONP is a comma separated list of elements of the form |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
233 "token" or "token=value", getsubopt parses the first of these elements. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
234 If the first element refers to a "token" that is member of the given |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
235 NULL-terminated array of tokens: |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
236 - It replaces the comma with a NUL byte, updates *OPTIONP to point past |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
237 the first option and the comma, sets *VALUEP to the value of the |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
238 element (or NULL if it doesn't contain an "=" sign), |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
239 - It returns the index of the "token" in the given array of tokens. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
240 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
241 For more details see the POSIX:2001 specification. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
242 http://www.opengroup.org/susv3xsh/getsubopt.html */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
243 # if !@HAVE_GETSUBOPT@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
244 _GL_FUNCDECL_SYS (getsubopt, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
245 (char **optionp, char *const *tokens, char **valuep) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
246 _GL_ARG_NONNULL ((1, 2, 3))); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
247 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
248 _GL_CXXALIAS_SYS (getsubopt, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
249 (char **optionp, char *const *tokens, char **valuep)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
250 _GL_CXXALIASWARN (getsubopt); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
251 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
252 # undef getsubopt |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
253 # if HAVE_RAW_DECL_GETSUBOPT |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
254 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
255 "use gnulib module getsubopt for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
256 # endif |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
257 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
258 |
13028 | 259 #if @GNULIB_GRANTPT@ |
260 /* Change the ownership and access permission of the slave side of the | |
261 pseudo-terminal whose master side is specified by FD. */ | |
262 # if !@HAVE_GRANTPT@ | |
263 _GL_FUNCDECL_SYS (grantpt, int, (int fd)); | |
264 # endif | |
265 _GL_CXXALIAS_SYS (grantpt, int, (int fd)); | |
266 _GL_CXXALIASWARN (grantpt); | |
267 #elif defined GNULIB_POSIXCHECK | |
268 # undef grantpt | |
269 # if HAVE_RAW_DECL_GRANTPT | |
16054 | 270 _GL_WARN_ON_USE (grantpt, "grantpt is not portable - " |
13028 | 271 "use gnulib module grantpt for portability"); |
272 # endif | |
273 #endif | |
274 | |
14538
cd02b552d886
stdlib: let modules use system malloc, realloc
Paul Eggert <eggert@cs.ucla.edu>
parents:
14378
diff
changeset
|
275 /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not |
cd02b552d886
stdlib: let modules use system malloc, realloc
Paul Eggert <eggert@cs.ucla.edu>
parents:
14378
diff
changeset
|
276 rely on GNU or POSIX semantics for malloc and realloc (for example, |
cd02b552d886
stdlib: let modules use system malloc, realloc
Paul Eggert <eggert@cs.ucla.edu>
parents:
14378
diff
changeset
|
277 by never specifying a zero size), so it does not need malloc or |
cd02b552d886
stdlib: let modules use system malloc, realloc
Paul Eggert <eggert@cs.ucla.edu>
parents:
14378
diff
changeset
|
278 realloc to be redefined. */ |
14548
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
279 #if @GNULIB_MALLOC_POSIX@ |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
280 # if @REPLACE_MALLOC@ |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
281 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
282 || _GL_USE_STDLIB_ALLOC) |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
283 # undef malloc |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
284 # define malloc rpl_malloc |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
285 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
286 _GL_FUNCDECL_RPL (malloc, void *, (size_t size)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
287 _GL_CXXALIAS_RPL (malloc, void *, (size_t size)); |
14548
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
288 # else |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
289 _GL_CXXALIAS_SYS (malloc, void *, (size_t size)); |
14548
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
290 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
291 _GL_CXXALIASWARN (malloc); |
14548
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
292 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
293 # undef malloc |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
294 /* Assume malloc is always declared. */ |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
295 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
296 "use gnulib module malloc-posix for portability"); |
11997 | 297 #endif |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
298 |
14377 | 299 /* Convert a multibyte character to a wide character. */ |
300 #if @GNULIB_MBTOWC@ | |
301 # if @REPLACE_MBTOWC@ | |
302 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | |
303 # undef mbtowc | |
304 # define mbtowc rpl_mbtowc | |
305 # endif | |
306 _GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); | |
307 _GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); | |
308 # else | |
40133
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
309 # if !@HAVE_MBTOWC@ |
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
310 _GL_FUNCDECL_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
311 # endif |
14377 | 312 _GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
313 # endif | |
314 _GL_CXXALIASWARN (mbtowc); | |
40133
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
315 #elif defined GNULIB_POSIXCHECK |
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
316 # undef mbtowc |
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
317 # if HAVE_RAW_DECL_MBTOWC |
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
318 _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " |
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
319 "use gnulib module mbtowc for portability"); |
11b97647fb11
mbtowc: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
320 # endif |
14377 | 321 #endif |
322 | |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
323 #if @GNULIB_MKDTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
324 /* Create a unique temporary directory from TEMPLATE. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
325 The last six characters of TEMPLATE must be "XXXXXX"; |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
326 they are replaced with a string that makes the directory name unique. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
327 Returns TEMPLATE, or a null pointer if it cannot get a unique name. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
328 The directory is created mode 700. */ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
329 # if !@HAVE_MKDTEMP@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
330 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1))); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
331 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
332 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
333 _GL_CXXALIASWARN (mkdtemp); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
334 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
335 # undef mkdtemp |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
336 # if HAVE_RAW_DECL_MKDTEMP |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
337 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
338 "use gnulib module mkdtemp for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
339 # endif |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
340 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
341 |
11882 | 342 #if @GNULIB_MKOSTEMP@ |
343 /* Create a unique temporary file from TEMPLATE. | |
344 The last six characters of TEMPLATE must be "XXXXXX"; | |
345 they are replaced with a string that makes the file name unique. | |
346 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) | |
347 and O_TEXT, O_BINARY (defined in "binary-io.h"). | |
348 The file is then created, with the specified flags, ensuring it didn't exist | |
349 before. | |
350 The file is created read-write (mask at least 0600 & ~umask), but it may be | |
351 world-readable and world-writable (mask 0666 & ~umask), depending on the | |
352 implementation. | |
353 Returns the open file descriptor if successful, otherwise -1 and errno | |
354 set. */ | |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
355 # if !@HAVE_MKOSTEMP@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
356 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
357 _GL_ARG_NONNULL ((1))); |
11882 | 358 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
359 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
360 _GL_CXXALIASWARN (mkostemp); |
11882 | 361 #elif defined GNULIB_POSIXCHECK |
362 # undef mkostemp | |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
363 # if HAVE_RAW_DECL_MKOSTEMP |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
364 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
365 "use gnulib module mkostemp for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
366 # endif |
11882 | 367 #endif |
368 | |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
369 #if @GNULIB_MKOSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
370 /* Create a unique temporary file from TEMPLATE. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
371 The last six characters of TEMPLATE before a suffix of length |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
372 SUFFIXLEN must be "XXXXXX"; |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
373 they are replaced with a string that makes the file name unique. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
374 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
375 and O_TEXT, O_BINARY (defined in "binary-io.h"). |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
376 The file is then created, with the specified flags, ensuring it didn't exist |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
377 before. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
378 The file is created read-write (mask at least 0600 & ~umask), but it may be |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
379 world-readable and world-writable (mask 0666 & ~umask), depending on the |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
380 implementation. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
381 Returns the open file descriptor if successful, otherwise -1 and errno |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
382 set. */ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
383 # if !@HAVE_MKOSTEMPS@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
384 _GL_FUNCDECL_SYS (mkostemps, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
385 (char * /*template*/, int /*suffixlen*/, int /*flags*/) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
386 _GL_ARG_NONNULL ((1))); |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
387 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
388 _GL_CXXALIAS_SYS (mkostemps, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
389 (char * /*template*/, int /*suffixlen*/, int /*flags*/)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
390 _GL_CXXALIASWARN (mkostemps); |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
391 #elif defined GNULIB_POSIXCHECK |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
392 # undef mkostemps |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
393 # if HAVE_RAW_DECL_MKOSTEMPS |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
394 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
395 "use gnulib module mkostemps for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
396 # endif |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
397 #endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
398 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
399 #if @GNULIB_MKSTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
400 /* Create a unique temporary file from TEMPLATE. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
401 The last six characters of TEMPLATE must be "XXXXXX"; |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
402 they are replaced with a string that makes the file name unique. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
403 The file is then created, ensuring it didn't exist before. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
404 The file is created read-write (mask at least 0600 & ~umask), but it may be |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
405 world-readable and world-writable (mask 0666 & ~umask), depending on the |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
406 implementation. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
407 Returns the open file descriptor if successful, otherwise -1 and errno |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
408 set. */ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
409 # if @REPLACE_MKSTEMP@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
410 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
411 # define mkstemp rpl_mkstemp |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
412 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
413 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
414 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
415 # else |
13120
0f4b3b66e73c
mkstemp: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13114
diff
changeset
|
416 # if ! @HAVE_MKSTEMP@ |
0f4b3b66e73c
mkstemp: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13114
diff
changeset
|
417 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); |
0f4b3b66e73c
mkstemp: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13114
diff
changeset
|
418 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
419 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/)); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
420 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
421 _GL_CXXALIASWARN (mkstemp); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
422 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
423 # undef mkstemp |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
424 # if HAVE_RAW_DECL_MKSTEMP |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
425 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
426 "use gnulib module mkstemp for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
427 # endif |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
428 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
429 |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
430 #if @GNULIB_MKSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
431 /* Create a unique temporary file from TEMPLATE. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
432 The last six characters of TEMPLATE prior to a suffix of length |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
433 SUFFIXLEN must be "XXXXXX"; |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
434 they are replaced with a string that makes the file name unique. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
435 The file is then created, ensuring it didn't exist before. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
436 The file is created read-write (mask at least 0600 & ~umask), but it may be |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
437 world-readable and world-writable (mask 0666 & ~umask), depending on the |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
438 implementation. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
439 Returns the open file descriptor if successful, otherwise -1 and errno |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
440 set. */ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
441 # if !@HAVE_MKSTEMPS@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
442 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
443 _GL_ARG_NONNULL ((1))); |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
444 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
445 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
446 _GL_CXXALIASWARN (mkstemps); |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
447 #elif defined GNULIB_POSIXCHECK |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
448 # undef mkstemps |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
449 # if HAVE_RAW_DECL_MKSTEMPS |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
450 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
451 "use gnulib module mkstemps for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
452 # endif |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
453 #endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
454 |
15961 | 455 #if @GNULIB_POSIX_OPENPT@ |
456 /* Return an FD open to the master side of a pseudo-terminal. Flags should | |
457 include O_RDWR, and may also include O_NOCTTY. */ | |
458 # if !@HAVE_POSIX_OPENPT@ | |
459 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); | |
460 # endif | |
461 _GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); | |
462 _GL_CXXALIASWARN (posix_openpt); | |
463 #elif defined GNULIB_POSIXCHECK | |
464 # undef posix_openpt | |
465 # if HAVE_RAW_DECL_POSIX_OPENPT | |
466 _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " | |
467 "use gnulib module posix_openpt for portability"); | |
468 # endif | |
469 #endif | |
470 | |
13025 | 471 #if @GNULIB_PTSNAME@ |
472 /* Return the pathname of the pseudo-terminal slave associated with | |
473 the master FD is open on, or NULL on errors. */ | |
17121
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
474 # if @REPLACE_PTSNAME@ |
17127
b2e34813288d
ptsname: fix macro-name typo
Paul Eggert <eggert@cs.ucla.edu>
parents:
17121
diff
changeset
|
475 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
17121
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
476 # undef ptsname |
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
477 # define ptsname rpl_ptsname |
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
478 # endif |
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
479 _GL_FUNCDECL_RPL (ptsname, char *, (int fd)); |
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
480 _GL_CXXALIAS_RPL (ptsname, char *, (int fd)); |
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
481 # else |
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
482 # if !@HAVE_PTSNAME@ |
13025 | 483 _GL_FUNCDECL_SYS (ptsname, char *, (int fd)); |
17121
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
484 # endif |
4e2101c3d42c
ptsname: reject invalid file descriptors
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
485 _GL_CXXALIAS_SYS (ptsname, char *, (int fd)); |
13025 | 486 # endif |
487 _GL_CXXALIASWARN (ptsname); | |
488 #elif defined GNULIB_POSIXCHECK | |
489 # undef ptsname | |
490 # if HAVE_RAW_DECL_PTSNAME | |
491 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - " | |
492 "use gnulib module ptsname for portability"); | |
493 # endif | |
494 #endif | |
495 | |
16067 | 496 #if @GNULIB_PTSNAME_R@ |
497 /* Set the pathname of the pseudo-terminal slave associated with | |
498 the master FD is open on and return 0, or set errno and return | |
499 non-zero on errors. */ | |
16074
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
500 # if @REPLACE_PTSNAME_R@ |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
501 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
502 # undef ptsname_r |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
503 # define ptsname_r rpl_ptsname_r |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
504 # endif |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
505 _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
506 _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
507 # else |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
508 # if !@HAVE_PTSNAME_R@ |
16067 | 509 _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); |
16074
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
510 # endif |
cd0ee16f47e9
ptsname_r: Avoid compilation error on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
16067
diff
changeset
|
511 _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); |
16067 | 512 # endif |
513 _GL_CXXALIASWARN (ptsname_r); | |
514 #elif defined GNULIB_POSIXCHECK | |
515 # undef ptsname_r | |
516 # if HAVE_RAW_DECL_PTSNAME_R | |
517 _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " | |
518 "use gnulib module ptsname_r for portability"); | |
519 # endif | |
520 #endif | |
521 | |
9434
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
522 #if @GNULIB_PUTENV@ |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
523 # if @REPLACE_PUTENV@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
524 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
525 # undef putenv |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
526 # define putenv rpl_putenv |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
527 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
528 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
529 _GL_CXXALIAS_RPL (putenv, int, (char *string)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
530 # else |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
531 _GL_CXXALIAS_SYS (putenv, int, (char *string)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
532 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
533 _GL_CXXALIASWARN (putenv); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
534 #endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
535 |
17744
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
536 #if @GNULIB_QSORT_R@ |
18484
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
537 /* Sort an array of NMEMB elements, starting at address BASE, each element |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
538 occupying SIZE bytes, in ascending order according to the comparison |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
539 function COMPARE. */ |
17744
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
540 # if @REPLACE_QSORT_R@ |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
541 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
542 # undef qsort_r |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
543 # define qsort_r rpl_qsort_r |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
544 # endif |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
545 _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
546 int (*compare) (void const *, void const *, |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
547 void *), |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
548 void *arg) _GL_ARG_NONNULL ((1, 4))); |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
549 _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
550 int (*compare) (void const *, void const *, |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
551 void *), |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
552 void *arg)); |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
553 # else |
18484
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
554 # if !@HAVE_QSORT_R@ |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
555 _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
556 int (*compare) (void const *, void const *, |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
557 void *), |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
558 void *arg) _GL_ARG_NONNULL ((1, 4))); |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
559 # endif |
17744
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
560 _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
561 int (*compare) (void const *, void const *, |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
562 void *), |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
563 void *arg)); |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
564 # endif |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
565 _GL_CXXALIASWARN (qsort_r); |
18484
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
566 #elif defined GNULIB_POSIXCHECK |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
567 # undef qsort_r |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
568 # if HAVE_RAW_DECL_QSORT_R |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
569 _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
570 "use gnulib module qsort_r for portability"); |
f60027cad6de
qsort_r: Fix macrology for platforms that lack the function.
Bruno Haible <bruno@clisp.org>
parents:
18189
diff
changeset
|
571 # endif |
17744
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
572 #endif |
9c8d212db038
qsort_r: new module, for GNU-style qsort_r
Paul Eggert <eggert@cs.ucla.edu>
parents:
17576
diff
changeset
|
573 |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
574 |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
575 #if @GNULIB_RANDOM_R@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
576 # if !@HAVE_RANDOM_R@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
577 # ifndef RAND_MAX |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
578 # define RAND_MAX 2147483647 |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
579 # endif |
9434
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
580 # endif |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
581 #endif |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
582 |
16280 | 583 |
584 #if @GNULIB_RANDOM@ | |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
585 # if @REPLACE_RANDOM@ |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
586 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
587 # undef random |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
588 # define random rpl_random |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
589 # endif |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
590 _GL_FUNCDECL_RPL (random, long, (void)); |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
591 _GL_CXXALIAS_RPL (random, long, (void)); |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
592 # else |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
593 # if !@HAVE_RANDOM@ |
16280 | 594 _GL_FUNCDECL_SYS (random, long, (void)); |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
595 # endif |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
596 _GL_CXXALIAS_SYS (random, long, (void)); |
16280 | 597 # endif |
598 _GL_CXXALIASWARN (random); | |
599 #elif defined GNULIB_POSIXCHECK | |
600 # undef random | |
601 # if HAVE_RAW_DECL_RANDOM | |
602 _GL_WARN_ON_USE (random, "random is unportable - " | |
603 "use gnulib module random for portability"); | |
604 # endif | |
605 #endif | |
606 | |
607 #if @GNULIB_RANDOM@ | |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
608 # if @REPLACE_RANDOM@ |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
609 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
610 # undef srandom |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
611 # define srandom rpl_srandom |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
612 # endif |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
613 _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed)); |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
614 _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
615 # else |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
616 # if !@HAVE_RANDOM@ |
16280 | 617 _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
618 # endif |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
619 _GL_CXXALIAS_SYS (srandom, void, (unsigned int seed)); |
16280 | 620 # endif |
621 _GL_CXXALIASWARN (srandom); | |
622 #elif defined GNULIB_POSIXCHECK | |
623 # undef srandom | |
624 # if HAVE_RAW_DECL_SRANDOM | |
625 _GL_WARN_ON_USE (srandom, "srandom is unportable - " | |
626 "use gnulib module random for portability"); | |
627 # endif | |
628 #endif | |
629 | |
630 #if @GNULIB_RANDOM@ | |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
631 # if @REPLACE_INITSTATE@ |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
632 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
633 # undef initstate |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
634 # define initstate rpl_initstate |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
635 # endif |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
636 _GL_FUNCDECL_RPL (initstate, char *, |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
637 (unsigned int seed, char *buf, size_t buf_size) |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
638 _GL_ARG_NONNULL ((2))); |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
639 _GL_CXXALIAS_RPL (initstate, char *, |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
640 (unsigned int seed, char *buf, size_t buf_size)); |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
641 # else |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
642 # if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@ |
16280 | 643 _GL_FUNCDECL_SYS (initstate, char *, |
644 (unsigned int seed, char *buf, size_t buf_size) | |
645 _GL_ARG_NONNULL ((2))); | |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
646 # endif |
16280 | 647 _GL_CXXALIAS_SYS (initstate, char *, |
648 (unsigned int seed, char *buf, size_t buf_size)); | |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
649 # endif |
16280 | 650 _GL_CXXALIASWARN (initstate); |
651 #elif defined GNULIB_POSIXCHECK | |
652 # undef initstate | |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
653 # if HAVE_RAW_DECL_INITSTATE |
16280 | 654 _GL_WARN_ON_USE (initstate, "initstate is unportable - " |
655 "use gnulib module random for portability"); | |
656 # endif | |
657 #endif | |
658 | |
659 #if @GNULIB_RANDOM@ | |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
660 # if @REPLACE_SETSTATE@ |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
661 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
662 # undef setstate |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
663 # define setstate rpl_setstate |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
664 # endif |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
665 _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
666 _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state)); |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
667 # else |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
668 # if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@ |
16280 | 669 _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
670 # endif |
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
671 _GL_CXXALIAS_SYS (setstate, char *, (char *arg_state)); |
16280 | 672 # endif |
673 _GL_CXXALIASWARN (setstate); | |
674 #elif defined GNULIB_POSIXCHECK | |
675 # undef setstate | |
40134
cfcc57a4ed05
random: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40133
diff
changeset
|
676 # if HAVE_RAW_DECL_SETSTATE |
16280 | 677 _GL_WARN_ON_USE (setstate, "setstate is unportable - " |
678 "use gnulib module random for portability"); | |
679 # endif | |
680 #endif | |
681 | |
682 | |
10704 | 683 #if @GNULIB_RANDOM_R@ |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
684 # if @REPLACE_RANDOM_R@ |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
685 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
686 # undef random_r |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
687 # define random_r rpl_random_r |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
688 # endif |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
689 _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
690 _GL_ARG_NONNULL ((1, 2))); |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
691 _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
692 # else |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
693 # if !@HAVE_RANDOM_R@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
694 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
695 _GL_ARG_NONNULL ((1, 2))); |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
696 # endif |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
697 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); |
10704 | 698 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
699 _GL_CXXALIASWARN (random_r); |
10704 | 700 #elif defined GNULIB_POSIXCHECK |
701 # undef random_r | |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
702 # if HAVE_RAW_DECL_RANDOM_R |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
703 _GL_WARN_ON_USE (random_r, "random_r is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
704 "use gnulib module random_r for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
705 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
706 #endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
707 |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
708 #if @GNULIB_RANDOM_R@ |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
709 # if @REPLACE_RANDOM_R@ |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
710 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
711 # undef srandom_r |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
712 # define srandom_r rpl_srandom_r |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
713 # endif |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
714 _GL_FUNCDECL_RPL (srandom_r, int, |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
715 (unsigned int seed, struct random_data *rand_state) |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
716 _GL_ARG_NONNULL ((2))); |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
717 _GL_CXXALIAS_RPL (srandom_r, int, |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
718 (unsigned int seed, struct random_data *rand_state)); |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
719 # else |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
720 # if !@HAVE_RANDOM_R@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
721 _GL_FUNCDECL_SYS (srandom_r, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
722 (unsigned int seed, struct random_data *rand_state) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
723 _GL_ARG_NONNULL ((2))); |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
724 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
725 _GL_CXXALIAS_SYS (srandom_r, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
726 (unsigned int seed, struct random_data *rand_state)); |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
727 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
728 _GL_CXXALIASWARN (srandom_r); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
729 #elif defined GNULIB_POSIXCHECK |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
730 # undef srandom_r |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
731 # if HAVE_RAW_DECL_SRANDOM_R |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
732 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
733 "use gnulib module random_r for portability"); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
734 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
735 #endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
736 |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
737 #if @GNULIB_RANDOM_R@ |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
738 # if @REPLACE_RANDOM_R@ |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
739 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
740 # undef initstate_r |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
741 # define initstate_r rpl_initstate_r |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
742 # endif |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
743 _GL_FUNCDECL_RPL (initstate_r, int, |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
744 (unsigned int seed, char *buf, size_t buf_size, |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
745 struct random_data *rand_state) |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
746 _GL_ARG_NONNULL ((2, 4))); |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
747 _GL_CXXALIAS_RPL (initstate_r, int, |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
748 (unsigned int seed, char *buf, size_t buf_size, |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
749 struct random_data *rand_state)); |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
750 # else |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
751 # if !@HAVE_RANDOM_R@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
752 _GL_FUNCDECL_SYS (initstate_r, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
753 (unsigned int seed, char *buf, size_t buf_size, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
754 struct random_data *rand_state) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
755 _GL_ARG_NONNULL ((2, 4))); |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
756 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
757 _GL_CXXALIAS_SYS (initstate_r, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
758 (unsigned int seed, char *buf, size_t buf_size, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
759 struct random_data *rand_state)); |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
760 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
761 _GL_CXXALIASWARN (initstate_r); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
762 #elif defined GNULIB_POSIXCHECK |
10704 | 763 # undef initstate_r |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
764 # if HAVE_RAW_DECL_INITSTATE_R |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
765 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
766 "use gnulib module random_r for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
767 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
768 #endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
769 |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
770 #if @GNULIB_RANDOM_R@ |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
771 # if @REPLACE_RANDOM_R@ |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
772 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
773 # undef setstate_r |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
774 # define setstate_r rpl_setstate_r |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
775 # endif |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
776 _GL_FUNCDECL_RPL (setstate_r, int, |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
777 (char *arg_state, struct random_data *rand_state) |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
778 _GL_ARG_NONNULL ((1, 2))); |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
779 _GL_CXXALIAS_RPL (setstate_r, int, |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
780 (char *arg_state, struct random_data *rand_state)); |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
781 # else |
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
782 # if !@HAVE_RANDOM_R@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
783 _GL_FUNCDECL_SYS (setstate_r, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
784 (char *arg_state, struct random_data *rand_state) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
785 _GL_ARG_NONNULL ((1, 2))); |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
786 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
787 _GL_CXXALIAS_SYS (setstate_r, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
788 (char *arg_state, struct random_data *rand_state)); |
16277
58a55a7ffba8
random_r: Override incompatible API on AIX, OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
789 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
790 _GL_CXXALIASWARN (setstate_r); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
791 #elif defined GNULIB_POSIXCHECK |
10704 | 792 # undef setstate_r |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
793 # if HAVE_RAW_DECL_SETSTATE_R |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
794 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
795 "use gnulib module random_r for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
796 # endif |
10704 | 797 #endif |
798 | |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
799 |
14548
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
800 #if @GNULIB_REALLOC_POSIX@ |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
801 # if @REPLACE_REALLOC@ |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
802 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
803 || _GL_USE_STDLIB_ALLOC) |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
804 # undef realloc |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
805 # define realloc rpl_realloc |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
806 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
807 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
808 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size)); |
14548
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
809 # else |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
810 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); |
14548
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
811 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
812 _GL_CXXALIASWARN (realloc); |
14548
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
813 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC |
df461a874ec9
* lib/stdlib.in.h (malloc, realloc): Limit this change to a smaller scope.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14538
diff
changeset
|
814 # undef realloc |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
815 /* Assume realloc is always declared. */ |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
816 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
817 "use gnulib module realloc-posix for portability"); |
11997 | 818 #endif |
10704 | 819 |
19049 | 820 |
821 #if @GNULIB_REALLOCARRAY@ | |
822 # if ! @HAVE_REALLOCARRAY@ | |
823 _GL_FUNCDECL_SYS (reallocarray, void *, | |
824 (void *ptr, size_t nmemb, size_t size)); | |
825 # endif | |
826 _GL_CXXALIAS_SYS (reallocarray, void *, | |
827 (void *ptr, size_t nmemb, size_t size)); | |
828 _GL_CXXALIASWARN (reallocarray); | |
829 #elif defined GNULIB_POSIXCHECK | |
830 # undef reallocarray | |
831 # if HAVE_RAW_DECL_REALLOCARRAY | |
832 _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " | |
833 "use gnulib module reallocarray for portability"); | |
834 # endif | |
835 #endif | |
836 | |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
837 #if @GNULIB_REALPATH@ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
838 # if @REPLACE_REALPATH@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
839 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
840 # define realpath rpl_realpath |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
841 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
842 _GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
843 _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
844 _GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
845 # else |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
846 # if !@HAVE_REALPATH@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
847 _GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
848 _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
849 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
850 _GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved)); |
12016
4fac822214af
canonicalize-lgpl: use native realpath if it works
Eric Blake <ebb9@byu.net>
parents:
12015
diff
changeset
|
851 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
852 _GL_CXXALIASWARN (realpath); |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
853 #elif defined GNULIB_POSIXCHECK |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
854 # undef realpath |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
855 # if HAVE_RAW_DECL_REALPATH |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
856 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
857 "canonicalize or canonicalize-lgpl for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
858 # endif |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
859 #endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
860 |
10001 | 861 #if @GNULIB_RPMATCH@ |
862 /* Test a user response to a question. | |
863 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ | |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
864 # if !@HAVE_RPMATCH@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
865 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1))); |
10001 | 866 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
867 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
868 _GL_CXXALIASWARN (rpmatch); |
10001 | 869 #elif defined GNULIB_POSIXCHECK |
870 # undef rpmatch | |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
871 # if HAVE_RAW_DECL_RPMATCH |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
872 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
873 "use gnulib module rpmatch for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
874 # endif |
10001 | 875 #endif |
876 | |
17313
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
877 #if @GNULIB_SECURE_GETENV@ |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
878 /* Look up NAME in the environment, returning 0 in insecure situations. */ |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
879 # if !@HAVE_SECURE_GETENV@ |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
880 _GL_FUNCDECL_SYS (secure_getenv, char *, |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
881 (char const *name) _GL_ARG_NONNULL ((1))); |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
882 # endif |
17325
0fb629c87fb5
secure_getenv: fix C++ declaration typo
Paul Eggert <eggert@cs.ucla.edu>
parents:
17313
diff
changeset
|
883 _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); |
17313
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
884 _GL_CXXALIASWARN (secure_getenv); |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
885 #elif defined GNULIB_POSIXCHECK |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
886 # undef secure_getenv |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
887 # if HAVE_RAW_DECL_SECURE_GETENV |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
888 _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
889 "use gnulib module secure_getenv for portability"); |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
890 # endif |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
891 #endif |
8108e0239bb6
secure_getenv: new module
Paul Eggert <eggert@cs.ucla.edu>
parents:
17277
diff
changeset
|
892 |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
893 #if @GNULIB_SETENV@ |
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
894 /* Set NAME to VALUE in the environment. |
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
895 If REPLACE is nonzero, overwrite an existing value. */ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
896 # if @REPLACE_SETENV@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
897 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
898 # undef setenv |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
899 # define setenv rpl_setenv |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
900 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
901 _GL_FUNCDECL_RPL (setenv, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
902 (const char *name, const char *value, int replace) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
903 _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
904 _GL_CXXALIAS_RPL (setenv, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
905 (const char *name, const char *value, int replace)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
906 # else |
13947
4ca29955b657
setenv: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13796
diff
changeset
|
907 # if !@HAVE_DECL_SETENV@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
908 _GL_FUNCDECL_SYS (setenv, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
909 (const char *name, const char *value, int replace) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
910 _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
911 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
912 _GL_CXXALIAS_SYS (setenv, int, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
913 (const char *name, const char *value, int replace)); |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
914 # endif |
13947
4ca29955b657
setenv: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13796
diff
changeset
|
915 # if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@) |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
916 _GL_CXXALIASWARN (setenv); |
13947
4ca29955b657
setenv: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13796
diff
changeset
|
917 # endif |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
918 #elif defined GNULIB_POSIXCHECK |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
919 # undef setenv |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
920 # if HAVE_RAW_DECL_SETENV |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
921 _GL_WARN_ON_USE (setenv, "setenv is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
922 "use gnulib module setenv for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
923 # endif |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
924 #endif |
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
925 |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
926 #if @GNULIB_STRTOD@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
927 /* Parse a double from STRING, updating ENDP if appropriate. */ |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
928 # if @REPLACE_STRTOD@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
929 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
930 # define strtod rpl_strtod |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
931 # endif |
40173
b716418da8b9
c-strtod, c-strtold: Use the bug fixes for strtod, strtold.
Bruno Haible <bruno@clisp.org>
parents:
40166
diff
changeset
|
932 # define GNULIB_defined_strtod_function 1 |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
933 _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
934 _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
935 _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
936 # else |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
937 # if !@HAVE_STRTOD@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
938 _GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
939 _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
940 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
941 _GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp)); |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
942 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
943 _GL_CXXALIASWARN (strtod); |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
944 #elif defined GNULIB_POSIXCHECK |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
945 # undef strtod |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
946 # if HAVE_RAW_DECL_STRTOD |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
947 _GL_WARN_ON_USE (strtod, "strtod is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
948 "use gnulib module strtod for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
949 # endif |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
950 #endif |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
951 |
40166 | 952 #if @GNULIB_STRTOLD@ |
953 /* Parse a 'long double' from STRING, updating ENDP if appropriate. */ | |
954 # if @REPLACE_STRTOLD@ | |
955 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | |
956 # define strtold rpl_strtold | |
957 # endif | |
40173
b716418da8b9
c-strtod, c-strtold: Use the bug fixes for strtod, strtold.
Bruno Haible <bruno@clisp.org>
parents:
40166
diff
changeset
|
958 # define GNULIB_defined_strtold_function 1 |
40166 | 959 _GL_FUNCDECL_RPL (strtold, long double, (const char *str, char **endp) |
960 _GL_ARG_NONNULL ((1))); | |
961 _GL_CXXALIAS_RPL (strtold, long double, (const char *str, char **endp)); | |
962 # else | |
963 # if !@HAVE_STRTOLD@ | |
964 _GL_FUNCDECL_SYS (strtold, long double, (const char *str, char **endp) | |
965 _GL_ARG_NONNULL ((1))); | |
966 # endif | |
967 _GL_CXXALIAS_SYS (strtold, long double, (const char *str, char **endp)); | |
968 # endif | |
969 _GL_CXXALIASWARN (strtold); | |
970 #elif defined GNULIB_POSIXCHECK | |
971 # undef strtold | |
972 # if HAVE_RAW_DECL_STRTOLD | |
973 _GL_WARN_ON_USE (strtold, "strtold is unportable - " | |
974 "use gnulib module strtold for portability"); | |
975 # endif | |
976 #endif | |
977 | |
10671
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
978 #if @GNULIB_STRTOLL@ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
979 /* Parse a signed integer whose textual representation starts at STRING. |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
980 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
981 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
982 "0x"). |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
983 If ENDPTR is not NULL, the address of the first byte after the integer is |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
984 stored in *ENDPTR. |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
985 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
986 to ERANGE. */ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
987 # if !@HAVE_STRTOLL@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
988 _GL_FUNCDECL_SYS (strtoll, long long, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
989 (const char *string, char **endptr, int base) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
990 _GL_ARG_NONNULL ((1))); |
10671
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
991 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
992 _GL_CXXALIAS_SYS (strtoll, long long, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
993 (const char *string, char **endptr, int base)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
994 _GL_CXXALIASWARN (strtoll); |
10671
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
995 #elif defined GNULIB_POSIXCHECK |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
996 # undef strtoll |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
997 # if HAVE_RAW_DECL_STRTOLL |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
998 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
999 "use gnulib module strtoll for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1000 # endif |
10671
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
1001 #endif |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
1002 |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1003 #if @GNULIB_STRTOULL@ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1004 /* Parse an unsigned integer whose textual representation starts at STRING. |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1005 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1006 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1007 "0x"). |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1008 If ENDPTR is not NULL, the address of the first byte after the integer is |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1009 stored in *ENDPTR. |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1010 Upon overflow, the return value is ULLONG_MAX, and errno is set to |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1011 ERANGE. */ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1012 # if !@HAVE_STRTOULL@ |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1013 _GL_FUNCDECL_SYS (strtoull, unsigned long long, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1014 (const char *string, char **endptr, int base) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1015 _GL_ARG_NONNULL ((1))); |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1016 # endif |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1017 _GL_CXXALIAS_SYS (strtoull, unsigned long long, |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1018 (const char *string, char **endptr, int base)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1019 _GL_CXXALIASWARN (strtoull); |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1020 #elif defined GNULIB_POSIXCHECK |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1021 # undef strtoull |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1022 # if HAVE_RAW_DECL_STRTOULL |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1023 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1024 "use gnulib module strtoull for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1025 # endif |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1026 #endif |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1027 |
13030 | 1028 #if @GNULIB_UNLOCKPT@ |
1029 /* Unlock the slave side of the pseudo-terminal whose master side is specified | |
1030 by FD, so that it can be opened. */ | |
1031 # if !@HAVE_UNLOCKPT@ | |
1032 _GL_FUNCDECL_SYS (unlockpt, int, (int fd)); | |
1033 # endif | |
1034 _GL_CXXALIAS_SYS (unlockpt, int, (int fd)); | |
1035 _GL_CXXALIASWARN (unlockpt); | |
1036 #elif defined GNULIB_POSIXCHECK | |
1037 # undef unlockpt | |
1038 # if HAVE_RAW_DECL_UNLOCKPT | |
13693
9b64bed10922
unlockpt: Fix declaration within GNULIB_POSIXCHECK.
Bruno Haible <bruno@clisp.org>
parents:
13683
diff
changeset
|
1039 _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " |
13030 | 1040 "use gnulib module unlockpt for portability"); |
1041 # endif | |
1042 #endif | |
1043 | |
11997 | 1044 #if @GNULIB_UNSETENV@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1045 /* Remove the variable NAME from the environment. */ |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
1046 # if @REPLACE_UNSETENV@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1047 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1048 # undef unsetenv |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1049 # define unsetenv rpl_unsetenv |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1050 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1051 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1052 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1053 # else |
13948
4d99f06b61cd
unsetenv: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13947
diff
changeset
|
1054 # if !@HAVE_DECL_UNSETENV@ |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1055 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1056 # endif |
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1057 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
1058 # endif |
13948
4d99f06b61cd
unsetenv: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13947
diff
changeset
|
1059 # if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@) |
12941
0c9896a5a035
stdlib: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
1060 _GL_CXXALIASWARN (unsetenv); |
13948
4d99f06b61cd
unsetenv: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13947
diff
changeset
|
1061 # endif |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
1062 #elif defined GNULIB_POSIXCHECK |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
1063 # undef unsetenv |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1064 # if HAVE_RAW_DECL_UNSETENV |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1065 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1066 "use gnulib module unsetenv for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
1067 # endif |
11997 | 1068 #endif |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
1069 |
14378 | 1070 /* Convert a wide character to a multibyte character. */ |
1071 #if @GNULIB_WCTOMB@ | |
1072 # if @REPLACE_WCTOMB@ | |
1073 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | |
1074 # undef wctomb | |
1075 # define wctomb rpl_wctomb | |
1076 # endif | |
1077 _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); | |
1078 _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); | |
1079 # else | |
1080 _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); | |
1081 # endif | |
1082 _GL_CXXALIASWARN (wctomb); | |
1083 #endif | |
1084 | |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1085 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14639
diff
changeset
|
1086 #endif /* _@GUARD_PREFIX@_STDLIB_H */ |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14639
diff
changeset
|
1087 #endif /* _@GUARD_PREFIX@_STDLIB_H */ |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1088 #endif |