Mercurial > hg > octave-shane > gnulib-hg
annotate lib/stdio.in.h @ 12488:9bd9b7a4b42b
build: pull in conditional headers during GNULIB_POSIXCHECK
Any time we conditionally include a header in order to satisfy
prerequisites of one module, we must also include that header
under GNULIB_POSIXCHECK to avoid compilation errors if that
module is not in use. If this is not done, then our link warning
override can occur before the system's declaration, which
causes a syntax error when the system header is finally included.
* lib/stdio.in.h (includes): Using GNULIB_POSIXCHECK also requires
definitions from any conditionally-included headers.
* lib/stdlib.in.h (includes): Likewise.
* lib/unistd.in.h (includes): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Thu, 24 Dec 2009 06:01:43 -0700 |
parents | 419d4e1a3d41 |
children | c2cbabec01dd |
rev | line source |
---|---|
9262 | 1 /* A GNU-like <stdio.h>. |
2 | |
11653 | 3 Copyright (C) 2004, 2007-2009 Free Software Foundation, Inc. |
9262 | 4 |
5 This program is free software; you can redistribute it and/or modify | |
6 it under the terms of the GNU General Public License as published by | |
7 the Free Software Foundation; either version 2, or (at your option) | |
8 any later version. | |
9 | |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU General Public License | |
16 along with this program; if not, write to the Free Software Foundation, | |
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ | |
18 | |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10622
diff
changeset
|
19 #if __GNUC__ >= 3 |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
10205
diff
changeset
|
20 @PRAGMA_SYSTEM_HEADER@ |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10622
diff
changeset
|
21 #endif |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
10205
diff
changeset
|
22 |
9262 | 23 #if defined __need_FILE || defined __need___FILE |
24 /* Special invocation convention inside glibc header files. */ | |
25 | |
26 #@INCLUDE_NEXT@ @NEXT_STDIO_H@ | |
27 | |
28 #else | |
29 /* Normal invocation convention. */ | |
30 | |
31 #ifndef _GL_STDIO_H | |
32 | |
33 /* The include_next requires a split double-inclusion guard. */ | |
34 #@INCLUDE_NEXT@ @NEXT_STDIO_H@ | |
35 | |
36 #ifndef _GL_STDIO_H | |
37 #define _GL_STDIO_H | |
38 | |
39 #include <stdarg.h> | |
40 #include <stddef.h> | |
41 | |
12488
9bd9b7a4b42b
build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents:
12451
diff
changeset
|
42 #if ((@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \ |
9bd9b7a4b42b
build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents:
12451
diff
changeset
|
43 || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \ |
9bd9b7a4b42b
build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents:
12451
diff
changeset
|
44 || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \ |
9bd9b7a4b42b
build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents:
12451
diff
changeset
|
45 || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@)) \ |
9bd9b7a4b42b
build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents:
12451
diff
changeset
|
46 || defined GNULIB_POSIXCHECK) |
9262 | 47 /* Get off_t and ssize_t. */ |
48 # include <sys/types.h> | |
49 #endif | |
50 | |
51 #ifndef __attribute__ | |
52 /* This feature is available in gcc versions 2.5 and later. */ | |
9613
c4fa39bf5223
Don't redefine __attribute__ without a need.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
53 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) |
9262 | 54 # define __attribute__(Spec) /* empty */ |
55 # endif | |
56 /* The __-protected variants of `format' and `printf' attributes | |
57 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ | |
58 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) | |
59 # define __format__ format | |
60 # define __printf__ printf | |
61 # endif | |
62 #endif | |
63 | |
64 | |
65 /* The definition of GL_LINK_WARNING is copied here. */ | |
66 | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
67 /* The definition of _GL_ARG_NONNULL is copied here. */ |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
68 |
9262 | 69 |
70 #ifdef __cplusplus | |
71 extern "C" { | |
72 #endif | |
73 | |
11971 | 74 #if @GNULIB_DPRINTF@ |
75 # if @REPLACE_DPRINTF@ | |
76 # define dprintf rpl_dprintf | |
77 # endif | |
78 # if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@ | |
79 extern int dprintf (int fd, const char *format, ...) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
80 __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((2)); |
11971 | 81 # endif |
82 #elif defined GNULIB_POSIXCHECK | |
83 # undef dprintf | |
12451
419d4e1a3d41
fcntl-h, stdio, sys_ioctl: fix declarations
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
84 # define dprintf \ |
11971 | 85 (GL_LINK_WARNING ("dprintf is unportable - " \ |
86 "use gnulib module dprintf for portability"), \ | |
12451
419d4e1a3d41
fcntl-h, stdio, sys_ioctl: fix declarations
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
87 dprintf) |
11971 | 88 #endif |
89 | |
90 #if @GNULIB_FCLOSE@ | |
91 # if @REPLACE_FCLOSE@ | |
92 # define fclose rpl_fclose | |
93 /* Close STREAM and its underlying file descriptor. */ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
94 extern int fclose (FILE *stream) _GL_ARG_NONNULL ((1)); |
11971 | 95 # endif |
96 #elif defined GNULIB_POSIXCHECK | |
97 # undef fclose | |
98 # define fclose(f) \ | |
99 (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \ | |
100 "use gnulib module fclose for portable " \ | |
101 "POSIX compliance"), \ | |
102 fclose (f)) | |
103 #endif | |
104 | |
105 #if @GNULIB_FFLUSH@ | |
106 # if @REPLACE_FFLUSH@ | |
107 # define fflush rpl_fflush | |
108 /* Flush all pending data on STREAM according to POSIX rules. Both | |
109 output and seekable input streams are supported. | |
110 Note! LOSS OF DATA can occur if fflush is applied on an input stream | |
111 that is _not_seekable_ or on an update stream that is _not_seekable_ | |
112 and in which the most recent operation was input. Seekability can | |
113 be tested with lseek(fileno(fp),0,SEEK_CUR). */ | |
114 extern int fflush (FILE *gl_stream); | |
115 # endif | |
116 #elif defined GNULIB_POSIXCHECK | |
117 # undef fflush | |
118 # define fflush(f) \ | |
119 (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \ | |
120 "use gnulib module fflush for portable " \ | |
121 "POSIX compliance"), \ | |
122 fflush (f)) | |
123 #endif | |
124 | |
125 #if @GNULIB_FOPEN@ | |
126 # if @REPLACE_FOPEN@ | |
127 # undef fopen | |
128 # define fopen rpl_fopen | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
129 extern FILE * fopen (const char *filename, const char *mode) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
130 _GL_ARG_NONNULL ((1, 2)); |
11971 | 131 # endif |
132 #elif defined GNULIB_POSIXCHECK | |
133 # undef fopen | |
134 # define fopen(f,m) \ | |
135 (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \ | |
136 "use gnulib module fopen for portability"), \ | |
137 fopen (f, m)) | |
138 #endif | |
9262 | 139 |
140 #if @GNULIB_FPRINTF_POSIX@ | |
141 # if @REPLACE_FPRINTF@ | |
142 # define fprintf rpl_fprintf | |
143 extern int fprintf (FILE *fp, const char *format, ...) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
144 __attribute__ ((__format__ (__printf__, 2, 3))) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
145 _GL_ARG_NONNULL ((1, 2)); |
9262 | 146 # endif |
10487
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
147 #elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ |
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
148 # define fprintf rpl_fprintf |
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
149 extern int fprintf (FILE *fp, const char *format, ...) |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
150 __attribute__ ((__format__ (__printf__, 2, 3))) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
151 _GL_ARG_NONNULL ((1, 2)); |
9262 | 152 #elif defined GNULIB_POSIXCHECK |
153 # undef fprintf | |
154 # define fprintf \ | |
155 (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \ | |
156 "use gnulib module fprintf-posix for portable " \ | |
157 "POSIX compliance"), \ | |
158 fprintf) | |
159 #endif | |
160 | |
11971 | 161 #if @GNULIB_FPURGE@ |
162 # if @REPLACE_FPURGE@ | |
163 # define fpurge rpl_fpurge | |
9262 | 164 # endif |
11971 | 165 # if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@ |
166 /* Discard all pending buffered I/O data on STREAM. | |
167 STREAM must not be wide-character oriented. | |
168 When discarding pending output, the file position is set back to where it | |
169 was before the write calls. When discarding pending input, the file | |
170 position is advanced to match the end of the previously read input. | |
171 Return 0 if successful. Upon error, return -1 and set errno. */ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
172 extern int fpurge (FILE *gl_stream) _GL_ARG_NONNULL ((1)); |
9262 | 173 # endif |
174 #elif defined GNULIB_POSIXCHECK | |
11971 | 175 # undef fpurge |
176 # define fpurge(f) \ | |
177 (GL_LINK_WARNING ("fpurge is not always present - " \ | |
178 "use gnulib module fpurge for portability"), \ | |
179 fpurge (f)) | |
11035
bf21f4597784
New modules 'dprintf', 'dprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
11033
diff
changeset
|
180 #endif |
bf21f4597784
New modules 'dprintf', 'dprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
11033
diff
changeset
|
181 |
11971 | 182 #if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ |
183 # undef fputc | |
184 # define fputc rpl_fputc | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
185 extern int fputc (int c, FILE *stream) _GL_ARG_NONNULL ((2)); |
9262 | 186 #endif |
187 | |
11971 | 188 #if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ |
189 # undef fputs | |
190 # define fputs rpl_fputs | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
191 extern int fputs (const char *string, FILE *stream) _GL_ARG_NONNULL ((1, 2)); |
9301
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
192 #endif |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
193 |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
194 #if @GNULIB_FREOPEN@ |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
195 # if @REPLACE_FREOPEN@ |
10528
97cab1215a7c
Tweak patch that overrides open() and fopen().
Bruno Haible <bruno@clisp.org>
parents:
10487
diff
changeset
|
196 # undef freopen |
9301
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
197 # define freopen rpl_freopen |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
198 extern FILE * freopen (const char *filename, const char *mode, FILE *stream) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
199 _GL_ARG_NONNULL ((2, 3)); |
9301
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
200 # endif |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
201 #elif defined GNULIB_POSIXCHECK |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
202 # undef freopen |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
203 # define freopen(f,m,s) \ |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
204 (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \ |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
205 "use gnulib module freopen for portability"), \ |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
206 freopen (f, m, s)) |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
207 #endif |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
9262
diff
changeset
|
208 |
9262 | 209 #if @GNULIB_FSEEK@ && @REPLACE_FSEEK@ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
210 extern int rpl_fseek (FILE *fp, long offset, int whence) _GL_ARG_NONNULL ((1)); |
9262 | 211 # undef fseek |
212 # if defined GNULIB_POSIXCHECK | |
213 # define fseek(f,o,w) \ | |
214 (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ | |
215 "on 32-bit platforms - " \ | |
216 "use fseeko function for handling of large files"), \ | |
217 rpl_fseek (f, o, w)) | |
218 # else | |
219 # define fseek rpl_fseek | |
220 # endif | |
221 #elif defined GNULIB_POSIXCHECK | |
222 # ifndef fseek | |
223 # define fseek(f,o,w) \ | |
224 (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ | |
225 "on 32-bit platforms - " \ | |
226 "use fseeko function for handling of large files"), \ | |
227 fseek (f, o, w)) | |
228 # endif | |
229 #endif | |
230 | |
11971 | 231 #if @GNULIB_FSEEKO@ |
232 # if @REPLACE_FSEEKO@ | |
233 /* Provide fseek, fseeko functions that are aware of a preceding | |
234 fflush(), and which detect pipes. */ | |
235 # define fseeko rpl_fseeko | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
236 extern int fseeko (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1)); |
12202
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
237 # if !@GNULIB_FSEEK@ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
238 # undef fseek |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
239 # define fseek(f,o,w) \ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
240 (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
241 "on 32-bit platforms - " \ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
242 "use fseeko function for handling of large files"), \ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
243 fseeko (f, o, w)) |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
244 # endif |
9262 | 245 # endif |
246 #elif defined GNULIB_POSIXCHECK | |
11971 | 247 # undef fseeko |
248 # define fseeko(f,o,w) \ | |
249 (GL_LINK_WARNING ("fseeko is unportable - " \ | |
250 "use gnulib module fseeko for portability"), \ | |
251 fseeko (f, o, w)) | |
9262 | 252 #endif |
253 | |
254 #if @GNULIB_FTELL@ && @REPLACE_FTELL@ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
255 extern long rpl_ftell (FILE *fp) _GL_ARG_NONNULL ((1)); |
9262 | 256 # undef ftell |
257 # if GNULIB_POSIXCHECK | |
258 # define ftell(f) \ | |
259 (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ | |
260 "on 32-bit platforms - " \ | |
261 "use ftello function for handling of large files"), \ | |
262 rpl_ftell (f)) | |
263 # else | |
264 # define ftell rpl_ftell | |
265 # endif | |
266 #elif defined GNULIB_POSIXCHECK | |
267 # ifndef ftell | |
268 # define ftell(f) \ | |
269 (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ | |
270 "on 32-bit platforms - " \ | |
271 "use ftello function for handling of large files"), \ | |
272 ftell (f)) | |
273 # endif | |
274 #endif | |
275 | |
11971 | 276 #if @GNULIB_FTELLO@ |
277 # if @REPLACE_FTELLO@ | |
278 # define ftello rpl_ftello | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
279 extern off_t ftello (FILE *fp) _GL_ARG_NONNULL ((1)); |
12202
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
280 # if !@GNULIB_FTELL@ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
281 # undef ftell |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
282 # define ftell(f) \ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
283 (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
284 "on 32-bit platforms - " \ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
285 "use ftello function for handling of large files"), \ |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
286 ftello (f)) |
a0f033ee41af
fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents:
12100
diff
changeset
|
287 # endif |
11653 | 288 # endif |
289 #elif defined GNULIB_POSIXCHECK | |
11971 | 290 # undef ftello |
291 # define ftello(f) \ | |
292 (GL_LINK_WARNING ("ftello is unportable - " \ | |
293 "use gnulib module ftello for portability"), \ | |
294 ftello (f)) | |
10487
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
295 #endif |
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
296 |
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
297 #if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ |
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
298 # undef fwrite |
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
299 # define fwrite rpl_fwrite |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
300 extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
301 _GL_ARG_NONNULL ((1, 4)); |
10487
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
302 #endif |
953f72c1ffcc
Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents:
10433
diff
changeset
|
303 |
9262 | 304 #if @GNULIB_GETDELIM@ |
305 # if !@HAVE_DECL_GETDELIM@ | |
306 /* Read input, up to (and including) the next occurrence of DELIMITER, from | |
307 STREAM, store it in *LINEPTR (and NUL-terminate it). | |
308 *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE | |
309 bytes of space. It is realloc'd as necessary. | |
310 Return the number of bytes read and stored at *LINEPTR (not including the | |
311 NUL terminator), or -1 on error or EOF. */ | |
312 extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter, | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
313 FILE *stream) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
314 _GL_ARG_NONNULL ((1, 2, 4)); |
9262 | 315 # endif |
316 #elif defined GNULIB_POSIXCHECK | |
317 # undef getdelim | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
318 # define getdelim(l, s, d, f) \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
319 (GL_LINK_WARNING ("getdelim is unportable - " \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
320 "use gnulib module getdelim for portability"), \ |
9262 | 321 getdelim (l, s, d, f)) |
322 #endif | |
323 | |
324 #if @GNULIB_GETLINE@ | |
325 # if @REPLACE_GETLINE@ | |
326 # undef getline | |
327 # define getline rpl_getline | |
328 # endif | |
329 # if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@ | |
330 /* Read a line, up to (and including) the next newline, from STREAM, store it | |
331 in *LINEPTR (and NUL-terminate it). | |
332 *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE | |
333 bytes of space. It is realloc'd as necessary. | |
334 Return the number of bytes read and stored at *LINEPTR (not including the | |
335 NUL terminator), or -1 on error or EOF. */ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
336 extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
337 _GL_ARG_NONNULL ((1, 2, 3)); |
9262 | 338 # endif |
339 #elif defined GNULIB_POSIXCHECK | |
340 # undef getline | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
341 # define getline(l, s, f) \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
342 (GL_LINK_WARNING ("getline is unportable - " \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
343 "use gnulib module getline for portability"), \ |
9262 | 344 getline (l, s, f)) |
345 #endif | |
346 | |
11971 | 347 #if @GNULIB_OBSTACK_PRINTF@ |
348 # if @REPLACE_OBSTACK_PRINTF@ | |
349 # define obstack_printf rpl_osbtack_printf | |
350 # define obstack_vprintf rpl_obstack_vprintf | |
351 # endif | |
352 # if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@ | |
353 struct obstack; | |
354 /* Grow an obstack with formatted output. Return the number of | |
355 bytes added to OBS. No trailing nul byte is added, and the | |
356 object should be closed with obstack_finish before use. Upon | |
357 memory allocation error, call obstack_alloc_failed_handler. Upon | |
358 other error, return -1. */ | |
359 extern int obstack_printf (struct obstack *obs, const char *format, ...) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
360 __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2)); |
11971 | 361 extern int obstack_vprintf (struct obstack *obs, const char *format, |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
362 va_list args) |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
363 __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2)); |
11971 | 364 # endif |
365 #endif | |
366 | |
10433 | 367 #if @GNULIB_PERROR@ |
368 # if @REPLACE_PERROR@ | |
369 # define perror rpl_perror | |
370 /* Print a message to standard error, describing the value of ERRNO, | |
371 (if STRING is not NULL and not empty) prefixed with STRING and ": ", | |
372 and terminated with a newline. */ | |
373 extern void perror (const char *string); | |
374 # endif | |
375 #elif defined GNULIB_POSIXCHECK | |
376 # undef perror | |
377 # define perror(s) \ | |
378 (GL_LINK_WARNING ("perror is not always POSIX compliant - " \ | |
379 "use gnulib module perror for portability"), \ | |
380 perror (s)) | |
381 #endif | |
382 | |
11971 | 383 #if @GNULIB_POPEN@ |
384 # if @REPLACE_POPEN@ | |
385 # undef popen | |
386 # define popen rpl_popen | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
387 extern FILE *popen (const char *cmd, const char *mode) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
388 _GL_ARG_NONNULL ((1, 2)); |
11971 | 389 # endif |
390 #elif defined GNULIB_POSIXCHECK | |
391 # undef popen | |
392 # define popen(c,m) \ | |
393 (GL_LINK_WARNING ("popen is buggy on some platforms - " \ | |
394 "use gnulib module popen or pipe for more portability"), \ | |
395 popen (c, m)) | |
396 #endif | |
397 | |
398 #if @GNULIB_PRINTF_POSIX@ | |
399 # if @REPLACE_PRINTF@ | |
400 /* Don't break __attribute__((format(printf,M,N))). */ | |
401 # define printf __printf__ | |
402 extern int printf (const char *format, ...) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
403 __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1)); |
11971 | 404 # endif |
405 #elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | |
406 /* Don't break __attribute__((format(printf,M,N))). */ | |
407 # define printf __printf__ | |
408 extern int printf (const char *format, ...) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
409 __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1)); |
11971 | 410 #elif defined GNULIB_POSIXCHECK |
411 # undef printf | |
412 # define printf \ | |
413 (GL_LINK_WARNING ("printf is not always POSIX compliant - " \ | |
414 "use gnulib module printf-posix for portable " \ | |
415 "POSIX compliance"), \ | |
416 printf) | |
417 /* Don't break __attribute__((format(printf,M,N))). */ | |
418 # define format(kind,m,n) format (__##kind##__, m, n) | |
419 # define __format__(kind,m,n) __format__ (__##kind##__, m, n) | |
420 # define ____printf____ __printf__ | |
421 # define ____scanf____ __scanf__ | |
422 # define ____strftime____ __strftime__ | |
423 # define ____strfmon____ __strfmon__ | |
424 #endif | |
425 | |
426 #if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | |
427 # undef putc | |
428 # define putc rpl_fputc | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
429 extern int putc (int c, FILE *stream) _GL_ARG_NONNULL ((2)); |
11971 | 430 #endif |
431 | |
432 #if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | |
433 # undef putchar | |
434 # define putchar rpl_putchar | |
435 extern int putchar (int c); | |
436 #endif | |
437 | |
438 #if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | |
439 # undef puts | |
440 # define puts rpl_puts | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
441 extern int puts (const char *string) _GL_ARG_NONNULL ((1)); |
11971 | 442 #endif |
443 | |
12041
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
444 #if @GNULIB_REMOVE@ |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
445 # if @REPLACE_REMOVE@ |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
446 # undef remove |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
447 # define remove rpl_remove |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
448 extern int remove (const char *name) _GL_ARG_NONNULL ((1)); |
12041
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
449 # endif |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
450 #elif defined GNULIB_POSIXCHECK |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
451 # undef remove |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
452 # define remove(n) \ |
12041
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
453 (GL_LINK_WARNING ("remove cannot handle directories on some platforms - " \ |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
454 "use gnulib module remove for more portability"), \ |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
455 remove (n)) |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
456 #endif |
73e9ab6e2c90
remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents:
11972
diff
changeset
|
457 |
11972 | 458 #if @GNULIB_RENAME@ |
459 # if @REPLACE_RENAME@ | |
460 # undef rename | |
461 # define rename rpl_rename | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
462 extern int rename (const char *old_filename, const char *new_filename) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
463 _GL_ARG_NONNULL ((1, 2)); |
11972 | 464 # endif |
465 #elif defined GNULIB_POSIXCHECK | |
466 # undef rename | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
467 # define rename(o,n) \ |
11972 | 468 (GL_LINK_WARNING ("rename is buggy on some platforms - " \ |
469 "use gnulib module rename for more portability"), \ | |
470 rename (o, n)) | |
471 #endif | |
472 | |
12099 | 473 #if @GNULIB_RENAMEAT@ |
12100 | 474 # if @REPLACE_RENAMEAT@ |
475 # undef renameat | |
476 # define renameat rpl_renameat | |
477 # endif | |
478 # if !@HAVE_RENAMEAT@ || @REPLACE_RENAMEAT@ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
479 extern int renameat (int fd1, char const *file1, int fd2, char const *file2) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
480 _GL_ARG_NONNULL ((2, 4)); |
12099 | 481 # endif |
482 #elif defined GNULIB_POSIXCHECK | |
483 # undef renameat | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12418
diff
changeset
|
484 # define renameat(d1,f1,d2,f2) \ |
12099 | 485 (GL_LINK_WARNING ("renameat is not portable - " \ |
486 "use gnulib module renameat for portability"), \ | |
487 renameat (d1, f1, d2, f2)) | |
488 #endif | |
489 | |
11971 | 490 #if @GNULIB_SNPRINTF@ |
491 # if @REPLACE_SNPRINTF@ | |
492 # define snprintf rpl_snprintf | |
493 # endif | |
494 # if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@ | |
495 extern int snprintf (char *str, size_t size, const char *format, ...) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
496 __attribute__ ((__format__ (__printf__, 3, 4))) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
497 _GL_ARG_NONNULL ((3)); |
11971 | 498 # endif |
499 #elif defined GNULIB_POSIXCHECK | |
500 # undef snprintf | |
501 # define snprintf \ | |
502 (GL_LINK_WARNING ("snprintf is unportable - " \ | |
503 "use gnulib module snprintf for portability"), \ | |
504 snprintf) | |
505 #endif | |
506 | |
507 #if @GNULIB_SPRINTF_POSIX@ | |
508 # if @REPLACE_SPRINTF@ | |
509 # define sprintf rpl_sprintf | |
510 extern int sprintf (char *str, const char *format, ...) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
511 __attribute__ ((__format__ (__printf__, 2, 3))) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
512 _GL_ARG_NONNULL ((1, 2)); |
11971 | 513 # endif |
514 #elif defined GNULIB_POSIXCHECK | |
515 # undef sprintf | |
516 # define sprintf \ | |
517 (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \ | |
518 "use gnulib module sprintf-posix for portable " \ | |
519 "POSIX compliance"), \ | |
520 sprintf) | |
521 #endif | |
522 | |
523 #if @GNULIB_VASPRINTF@ | |
524 # if @REPLACE_VASPRINTF@ | |
525 # define asprintf rpl_asprintf | |
526 # define vasprintf rpl_vasprintf | |
527 # endif | |
528 # if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@ | |
529 /* Write formatted output to a string dynamically allocated with malloc(). | |
530 If the memory allocation succeeds, store the address of the string in | |
531 *RESULT and return the number of resulting bytes, excluding the trailing | |
532 NUL. Upon memory allocation error, or some other error, return -1. */ | |
533 extern int asprintf (char **result, const char *format, ...) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
534 __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2)); |
11971 | 535 extern int vasprintf (char **result, const char *format, va_list args) |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
536 __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2)); |
11971 | 537 # endif |
538 #endif | |
539 | |
540 #if @GNULIB_VDPRINTF@ | |
541 # if @REPLACE_VDPRINTF@ | |
542 # define vdprintf rpl_vdprintf | |
543 # endif | |
544 # if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@ | |
545 extern int vdprintf (int fd, const char *format, va_list args) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
546 __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((2)); |
11971 | 547 # endif |
548 #elif defined GNULIB_POSIXCHECK | |
549 # undef vdprintf | |
550 # define vdprintf(d,f,a) \ | |
551 (GL_LINK_WARNING ("vdprintf is unportable - " \ | |
552 "use gnulib module vdprintf for portability"), \ | |
553 vdprintf (d, f, a)) | |
554 #endif | |
555 | |
556 #if @GNULIB_VFPRINTF_POSIX@ | |
557 # if @REPLACE_VFPRINTF@ | |
558 # define vfprintf rpl_vfprintf | |
559 extern int vfprintf (FILE *fp, const char *format, va_list args) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
560 __attribute__ ((__format__ (__printf__, 2, 0))) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
561 _GL_ARG_NONNULL ((1, 2)); |
11971 | 562 # endif |
563 #elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | |
564 # define vfprintf rpl_vfprintf | |
565 extern int vfprintf (FILE *fp, const char *format, va_list args) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
566 __attribute__ ((__format__ (__printf__, 2, 0))) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
567 _GL_ARG_NONNULL ((1, 2)); |
11971 | 568 #elif defined GNULIB_POSIXCHECK |
569 # undef vfprintf | |
570 # define vfprintf(s,f,a) \ | |
571 (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \ | |
572 "use gnulib module vfprintf-posix for portable " \ | |
573 "POSIX compliance"), \ | |
574 vfprintf (s, f, a)) | |
575 #endif | |
576 | |
577 #if @GNULIB_VPRINTF_POSIX@ | |
578 # if @REPLACE_VPRINTF@ | |
579 # define vprintf rpl_vprintf | |
580 extern int vprintf (const char *format, va_list args) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
581 __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1)); |
11971 | 582 # endif |
583 #elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | |
584 # define vprintf rpl_vprintf | |
585 extern int vprintf (const char *format, va_list args) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
586 __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1)); |
11971 | 587 #elif defined GNULIB_POSIXCHECK |
588 # undef vprintf | |
589 # define vprintf(f,a) \ | |
590 (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \ | |
591 "use gnulib module vprintf-posix for portable " \ | |
592 "POSIX compliance"), \ | |
593 vprintf (f, a)) | |
594 #endif | |
595 | |
596 #if @GNULIB_VSNPRINTF@ | |
597 # if @REPLACE_VSNPRINTF@ | |
598 # define vsnprintf rpl_vsnprintf | |
599 # endif | |
600 # if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@ | |
601 extern int vsnprintf (char *str, size_t size, const char *format, va_list args) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
602 __attribute__ ((__format__ (__printf__, 3, 0))) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
603 _GL_ARG_NONNULL ((3)); |
11971 | 604 # endif |
605 #elif defined GNULIB_POSIXCHECK | |
606 # undef vsnprintf | |
607 # define vsnprintf(b,s,f,a) \ | |
608 (GL_LINK_WARNING ("vsnprintf is unportable - " \ | |
609 "use gnulib module vsnprintf for portability"), \ | |
610 vsnprintf (b, s, f, a)) | |
611 #endif | |
612 | |
613 #if @GNULIB_VSPRINTF_POSIX@ | |
614 # if @REPLACE_VSPRINTF@ | |
615 # define vsprintf rpl_vsprintf | |
616 extern int vsprintf (char *str, const char *format, va_list args) | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
617 __attribute__ ((__format__ (__printf__, 2, 0))) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
618 _GL_ARG_NONNULL ((1, 2)); |
11971 | 619 # endif |
620 #elif defined GNULIB_POSIXCHECK | |
621 # undef vsprintf | |
622 # define vsprintf(b,f,a) \ | |
623 (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \ | |
624 "use gnulib module vsprintf-posix for portable " \ | |
625 "POSIX compliance"), \ | |
626 vsprintf (b, f, a)) | |
627 #endif | |
628 | |
9262 | 629 #ifdef __cplusplus |
630 } | |
631 #endif | |
632 | |
633 #endif /* _GL_STDIO_H */ | |
634 #endif /* _GL_STDIO_H */ | |
635 #endif |