annotate lib/stdlib.in.h @ 10375:f96e845fc36d

Avoid some "gcc -pedantic" warnings.
author Bruno Haible <bruno@clisp.org>
date Sat, 30 Aug 2008 03:09:15 +0200
parents facc928673d7
children 8668b19a7032
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
9821
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
3 Copyright (C) 1995, 2001-2004, 2006-2008 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
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 9263
diff changeset
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
9263
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
10375
f96e845fc36d Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 10001
diff changeset
18 @PRAGMA_SYSTEM_HEADER@
f96e845fc36d Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 10001
diff changeset
19
9263
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 #if defined __need_malloc_and_calloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 /* Special invocation convention inside glibc header files. */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #else
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 /* Normal invocation convention. */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #ifndef _GL_STDLIB_H
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 /* 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
31 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 #ifndef _GL_STDLIB_H
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 #define _GL_STDLIB_H
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 /* The definition of GL_LINK_WARNING is copied here. */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 /* 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
41 #ifndef EXIT_SUCCESS
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 # define EXIT_SUCCESS 0
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 /* 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
45 with proper operation of xargs. */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 #ifndef EXIT_FAILURE
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 # define EXIT_FAILURE 1
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 #elif EXIT_FAILURE != 1
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 # undef EXIT_FAILURE
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 # define EXIT_FAILURE 1
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 #ifdef __cplusplus
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 extern "C" {
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 #if @GNULIB_MALLOC_POSIX@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 # if !@HAVE_MALLOC_POSIX@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 # undef malloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 # define malloc rpl_malloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 extern void * malloc (size_t size);
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 # endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 #elif defined GNULIB_POSIXCHECK
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 # undef malloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 # define malloc(s) \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 "use gnulib module malloc-posix for portability"), \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 malloc (s))
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 #if @GNULIB_REALLOC_POSIX@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 # if !@HAVE_REALLOC_POSIX@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 # undef realloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 # define realloc rpl_realloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 extern void * realloc (void *ptr, size_t size);
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 # endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 #elif defined GNULIB_POSIXCHECK
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 # undef realloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 # define realloc(p,s) \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 "use gnulib module realloc-posix for portability"), \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 realloc (p, s))
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 #if @GNULIB_CALLOC_POSIX@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 # if !@HAVE_CALLOC_POSIX@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 # undef calloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 # define calloc rpl_calloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 extern void * calloc (size_t nmemb, size_t size);
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 # endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 #elif defined GNULIB_POSIXCHECK
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 # undef calloc
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 # define calloc(n,s) \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 "use gnulib module calloc-posix for portability"), \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 calloc (n, s))
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 #if @GNULIB_GETSUBOPT@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 /* 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
106 "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
107 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
108 NULL-terminated array of tokens:
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 - 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
110 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
111 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
112 - 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
113 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
114 For more details see the POSIX:2001 specification.
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 http://www.opengroup.org/susv3xsh/getsubopt.html */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 # if !@HAVE_GETSUBOPT@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 extern int getsubopt (char **optionp, char *const *tokens, char **valuep);
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 # endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 #elif defined GNULIB_POSIXCHECK
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 # undef getsubopt
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 # define getsubopt(o,t,v) \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 (GL_LINK_WARNING ("getsubopt is unportable - " \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 "use gnulib module getsubopt for portability"), \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 getsubopt (o, t, v))
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 #if @GNULIB_MKDTEMP@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129 # if !@HAVE_MKDTEMP@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130 /* Create a unique temporary directory from TEMPLATE.
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131 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
132 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
133 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
134 The directory is created mode 700. */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 extern char * mkdtemp (char * /*template*/);
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 # endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137 #elif defined GNULIB_POSIXCHECK
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 # undef mkdtemp
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 # define mkdtemp(t) \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 (GL_LINK_WARNING ("mkdtemp is unportable - " \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 "use gnulib module mkdtemp for portability"), \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 mkdtemp (t))
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 #if @GNULIB_MKSTEMP@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 # if @REPLACE_MKSTEMP@
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 /* Create a unique temporary file from TEMPLATE.
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149 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
150 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
151 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
152 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
153 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
154 implementation.
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
155 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
156 set. */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
157 # define mkstemp rpl_mkstemp
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
158 extern int mkstemp (char * /*template*/);
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
159 # else
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
160 /* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
161 # include <unistd.h>
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
162 # endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
163 #elif defined GNULIB_POSIXCHECK
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
164 # undef mkstemp
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
165 # define mkstemp(t) \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
166 (GL_LINK_WARNING ("mkstemp is unportable - " \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
167 "use gnulib module mkstemp for portability"), \
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
168 mkstemp (t))
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
169 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
170
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
171
9434
b839560eec9f Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
172 #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
173 # if @REPLACE_PUTENV@
b839560eec9f Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
174 # undef putenv
b839560eec9f Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
175 # define putenv rpl_putenv
b839560eec9f Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
176 extern int putenv (char *string);
b839560eec9f Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
177 # endif
b839560eec9f Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
178 #endif
b839560eec9f Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
179
b839560eec9f Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
180
10001
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
181 #if @GNULIB_RPMATCH@
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
182 # if !@HAVE_RPMATCH@
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
183 /* Test a user response to a question.
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
184 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
185 extern int rpmatch (const char *response);
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
186 # endif
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
187 #elif defined GNULIB_POSIXCHECK
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
188 # undef rpmatch
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
189 # define rpmatch(r) \
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
190 (GL_LINK_WARNING ("rpmatch is unportable - " \
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
191 "use gnulib module rpmatch for portability"), \
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
192 rpmatch (r))
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
193 #endif
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
194
facc928673d7 Declare rpmatch.
Bruno Haible <bruno@clisp.org>
parents: 9821
diff changeset
195
9545
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
196 #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
197 # if !@HAVE_SETENV@
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
198 /* 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
199 If REPLACE is nonzero, overwrite an existing value. */
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
200 extern int setenv (const char *name, const char *value, int replace);
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
201 # endif
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
202 #endif
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
203
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
204
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
205 #if @GNULIB_UNSETENV@
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
206 # if @HAVE_UNSETENV@
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
207 # if @VOID_UNSETENV@
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
208 /* On some systems, unsetenv() returns void.
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
209 This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
210 # define unsetenv(name) ((unsetenv)(name), 0)
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
211 # endif
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
212 # else
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
213 /* Remove the variable NAME from the environment. */
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
214 extern int unsetenv (const char *name);
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
215 # endif
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
216 #endif
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
217
c596ca4e89b4 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents: 9436
diff changeset
218
9821
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
219 #if @GNULIB_STRTOD@
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
220 # if @REPLACE_STRTOD@
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
221 # define strtod rpl_strtod
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
222 # endif
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
223 # if !@HAVE_STRTOD@ || @REPLACE_STRTOD@
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
224 /* Parse a double from STRING, updating ENDP if appropriate. */
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
225 extern double strtod (const char *str, char **endp);
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
226 # endif
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
227 #elif defined GNULIB_POSIXCHECK
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
228 # undef strtod
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
229 # define strtod(s, e) \
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
230 (GL_LINK_WARNING ("strtod is unportable - " \
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
231 "use gnulib module strtod for portability"), \
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
232 strtod (s, e))
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
233 #endif
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
234
18bab9955c43 Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents: 9545
diff changeset
235
9263
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
236 #ifdef __cplusplus
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
237 }
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
238 #endif
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
239
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
240 #endif /* _GL_STDLIB_H */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
241 #endif /* _GL_STDLIB_H */
bb62a6456893 Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
242 #endif