Import upstream version 1.26
[debian/tar] / gnu / stdio.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* A GNU-like <stdio.h>.
4
5    Copyright (C) 2004, 2007-2011 Free Software Foundation, Inc.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software Foundation,
19    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21 #if __GNUC__ >= 3
22 @PRAGMA_SYSTEM_HEADER@
23 #endif
24 @PRAGMA_COLUMNS@
25
26 #if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
27 /* Special invocation convention:
28    - Inside glibc header files.
29    - On OSF/1 5.1 we have a sequence of nested includes
30      <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
31      <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
32      In this situation, the functions are not yet declared, therefore we cannot
33      provide the C++ aliases.  */
34
35 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
36
37 #else
38 /* Normal invocation convention.  */
39
40 #ifndef _GL_STDIO_H
41
42 #define _GL_ALREADY_INCLUDING_STDIO_H
43
44 /* The include_next requires a split double-inclusion guard.  */
45 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
46
47 #undef _GL_ALREADY_INCLUDING_STDIO_H
48
49 #ifndef _GL_STDIO_H
50 #define _GL_STDIO_H
51
52 /* Get va_list.  Needed on many systems, including glibc 2.8.  */
53 #include <stdarg.h>
54
55 #include <stddef.h>
56
57 /* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8
58    and eglibc 2.11.2.  */
59 #include <sys/types.h>
60
61 /* The __attribute__ feature is available in gcc versions 2.5 and later.
62    The __-protected variants of the attributes 'format' and 'printf' are
63    accepted by gcc versions 2.6.4 (effectively 2.7) and later.
64    We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
65    gnulib and libintl do '#define printf __printf__' when they override
66    the 'printf' function.  */
67 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
68 # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
69 #else
70 # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
71 #endif
72 #define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
73   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
74
75 /* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
76 /* But in any case avoid namespace pollution on glibc systems.  */
77 #if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
78     && ! defined __GLIBC__
79 # include <unistd.h>
80 #endif
81
82
83 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
84
85 /* The definition of _GL_ARG_NONNULL is copied here.  */
86
87 /* The definition of _GL_WARN_ON_USE is copied here.  */
88
89 /* Macros for stringification.  */
90 #define _GL_STDIO_STRINGIZE(token) #token
91 #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
92
93
94 #if @GNULIB_DPRINTF@
95 # if @REPLACE_DPRINTF@
96 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
97 #   define dprintf rpl_dprintf
98 #  endif
99 _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
100                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
101                                 _GL_ARG_NONNULL ((2)));
102 _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
103 # else
104 #  if !@HAVE_DPRINTF@
105 _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
106                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
107                                 _GL_ARG_NONNULL ((2)));
108 #  endif
109 _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
110 # endif
111 _GL_CXXALIASWARN (dprintf);
112 #elif defined GNULIB_POSIXCHECK
113 # undef dprintf
114 # if HAVE_RAW_DECL_DPRINTF
115 _GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
116                  "use gnulib module dprintf for portability");
117 # endif
118 #endif
119
120 #if @GNULIB_FCLOSE@
121 /* Close STREAM and its underlying file descriptor.  */
122 # if @REPLACE_FCLOSE@
123 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
124 #   define fclose rpl_fclose
125 #  endif
126 _GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
127 _GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
128 # else
129 _GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
130 # endif
131 _GL_CXXALIASWARN (fclose);
132 #elif defined GNULIB_POSIXCHECK
133 # undef fclose
134 /* Assume fclose is always declared.  */
135 _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
136                  "use gnulib module fclose for portable POSIX compliance");
137 #endif
138
139 #if @GNULIB_FFLUSH@
140 /* Flush all pending data on STREAM according to POSIX rules.  Both
141    output and seekable input streams are supported.
142    Note! LOSS OF DATA can occur if fflush is applied on an input stream
143    that is _not_seekable_ or on an update stream that is _not_seekable_
144    and in which the most recent operation was input.  Seekability can
145    be tested with lseek(fileno(fp),0,SEEK_CUR).  */
146 # if @REPLACE_FFLUSH@
147 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
148 #   define fflush rpl_fflush
149 #  endif
150 _GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
151 _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
152 # else
153 _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
154 # endif
155 _GL_CXXALIASWARN (fflush);
156 #elif defined GNULIB_POSIXCHECK
157 # undef fflush
158 /* Assume fflush is always declared.  */
159 _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
160                  "use gnulib module fflush for portable POSIX compliance");
161 #endif
162
163 /* It is very rare that the developer ever has full control of stdin,
164    so any use of gets warrants an unconditional warning.  Assume it is
165    always declared, since it is required by C89.  */
166 #undef gets
167 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
168
169 #if @GNULIB_FOPEN@
170 # if @REPLACE_FOPEN@
171 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
172 #   undef fopen
173 #   define fopen rpl_fopen
174 #  endif
175 _GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
176                                  _GL_ARG_NONNULL ((1, 2)));
177 _GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
178 # else
179 _GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
180 # endif
181 _GL_CXXALIASWARN (fopen);
182 #elif defined GNULIB_POSIXCHECK
183 # undef fopen
184 /* Assume fopen is always declared.  */
185 _GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
186                  "use gnulib module fopen for portability");
187 #endif
188
189 #if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
190 # if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
191      || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
192 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
193 #   define fprintf rpl_fprintf
194 #  endif
195 #  define GNULIB_overrides_fprintf 1
196 _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
197                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
198                                 _GL_ARG_NONNULL ((1, 2)));
199 _GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
200 # else
201 _GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
202 # endif
203 _GL_CXXALIASWARN (fprintf);
204 #endif
205 #if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
206 # if !GNULIB_overrides_fprintf
207 #  undef fprintf
208 # endif
209 /* Assume fprintf is always declared.  */
210 _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
211                  "use gnulib module fprintf-posix for portable "
212                  "POSIX compliance");
213 #endif
214
215 #if @GNULIB_FPURGE@
216 /* Discard all pending buffered I/O data on STREAM.
217    STREAM must not be wide-character oriented.
218    When discarding pending output, the file position is set back to where it
219    was before the write calls.  When discarding pending input, the file
220    position is advanced to match the end of the previously read input.
221    Return 0 if successful.  Upon error, return -1 and set errno.  */
222 # if @REPLACE_FPURGE@
223 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
224 #   define fpurge rpl_fpurge
225 #  endif
226 _GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
227 _GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
228 # else
229 #  if !@HAVE_DECL_FPURGE@
230 _GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
231 #  endif
232 _GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
233 # endif
234 _GL_CXXALIASWARN (fpurge);
235 #elif defined GNULIB_POSIXCHECK
236 # undef fpurge
237 # if HAVE_RAW_DECL_FPURGE
238 _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
239                  "use gnulib module fpurge for portability");
240 # endif
241 #endif
242
243 #if @GNULIB_FPUTC@
244 # if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
245 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
246 #   undef fputc
247 #   define fputc rpl_fputc
248 #  endif
249 _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
250 _GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
251 # else
252 _GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
253 # endif
254 _GL_CXXALIASWARN (fputc);
255 #endif
256
257 #if @GNULIB_FPUTS@
258 # if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
259 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
260 #   undef fputs
261 #   define fputs rpl_fputs
262 #  endif
263 _GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
264                               _GL_ARG_NONNULL ((1, 2)));
265 _GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
266 # else
267 _GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
268 # endif
269 _GL_CXXALIASWARN (fputs);
270 #endif
271
272 #if @GNULIB_FREOPEN@
273 # if @REPLACE_FREOPEN@
274 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
275 #   undef freopen
276 #   define freopen rpl_freopen
277 #  endif
278 _GL_FUNCDECL_RPL (freopen, FILE *,
279                   (const char *filename, const char *mode, FILE *stream)
280                   _GL_ARG_NONNULL ((2, 3)));
281 _GL_CXXALIAS_RPL (freopen, FILE *,
282                   (const char *filename, const char *mode, FILE *stream));
283 # else
284 _GL_CXXALIAS_SYS (freopen, FILE *,
285                   (const char *filename, const char *mode, FILE *stream));
286 # endif
287 _GL_CXXALIASWARN (freopen);
288 #elif defined GNULIB_POSIXCHECK
289 # undef freopen
290 /* Assume freopen is always declared.  */
291 _GL_WARN_ON_USE (freopen,
292                  "freopen on Win32 platforms is not POSIX compatible - "
293                  "use gnulib module freopen for portability");
294 #endif
295
296
297 /* Set up the following warnings, based on which modules are in use.
298    GNU Coding Standards discourage the use of fseek, since it imposes
299    an arbitrary limitation on some 32-bit hosts.  Remember that the
300    fseek module depends on the fseeko module, so we only have three
301    cases to consider:
302
303    1. The developer is not using either module.  Issue a warning under
304    GNULIB_POSIXCHECK for both functions, to remind them that both
305    functions have bugs on some systems.  _GL_NO_LARGE_FILES has no
306    impact on this warning.
307
308    2. The developer is using both modules.  They may be unaware of the
309    arbitrary limitations of fseek, so issue a warning under
310    GNULIB_POSIXCHECK.  On the other hand, they may be using both
311    modules intentionally, so the developer can define
312    _GL_NO_LARGE_FILES in the compilation units where the use of fseek
313    is safe, to silence the warning.
314
315    3. The developer is using the fseeko module, but not fseek.  Gnulib
316    guarantees that fseek will still work around platform bugs in that
317    case, but we presume that the developer is aware of the pitfalls of
318    fseek and was trying to avoid it, so issue a warning even when
319    GNULIB_POSIXCHECK is undefined.  Again, _GL_NO_LARGE_FILES can be
320    defined to silence the warning in particular compilation units.
321    In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
322    fseek gets defined as a macro, it is recommended that the developer
323    uses the fseek module, even if he is not calling the fseek function.
324
325    Most gnulib clients that perform stream operations should fall into
326    category 3.  */
327
328 #if @GNULIB_FSEEK@
329 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
330 #  define _GL_FSEEK_WARN /* Category 2, above.  */
331 #  undef fseek
332 # endif
333 # if @REPLACE_FSEEK@
334 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
335 #   undef fseek
336 #   define fseek rpl_fseek
337 #  endif
338 _GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
339                               _GL_ARG_NONNULL ((1)));
340 _GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
341 # else
342 _GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
343 # endif
344 _GL_CXXALIASWARN (fseek);
345 #endif
346
347 #if @GNULIB_FSEEKO@
348 # if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
349 #  define _GL_FSEEK_WARN /* Category 3, above.  */
350 #  undef fseek
351 # endif
352 # if @REPLACE_FSEEKO@
353 /* Provide an fseeko function that is aware of a preceding fflush(), and which
354    detects pipes.  */
355 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
356 #   undef fseeko
357 #   define fseeko rpl_fseeko
358 #  endif
359 _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
360                                _GL_ARG_NONNULL ((1)));
361 _GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
362 # else
363 #  if ! @HAVE_DECL_FSEEKO@
364 _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
365                                _GL_ARG_NONNULL ((1)));
366 #  endif
367 _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
368 # endif
369 _GL_CXXALIASWARN (fseeko);
370 # if (@REPLACE_FSEEKO@ || !@HAVE_FSEEKO@) && !@GNULIB_FSEEK@
371    /* Provide an fseek function that is consistent with fseeko.  */
372    /* In order to avoid that fseek gets defined as a macro here, the
373       developer can request the 'fseek' module.  */
374 #  if !GNULIB_defined_fseek_function
375 #   undef fseek
376 #   define fseek rpl_fseek
377 static inline int _GL_ARG_NONNULL ((1))
378 rpl_fseek (FILE *fp, long offset, int whence)
379 {
380 #   if @REPLACE_FSEEKO@
381   return rpl_fseeko (fp, offset, whence);
382 #   else
383   return fseeko (fp, offset, whence);
384 #   endif
385 }
386 #   define GNULIB_defined_fseek_function 1
387 #  endif
388 # endif
389 #elif defined GNULIB_POSIXCHECK
390 # define _GL_FSEEK_WARN /* Category 1, above.  */
391 # undef fseek
392 # undef fseeko
393 # if HAVE_RAW_DECL_FSEEKO
394 _GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
395                  "use gnulib module fseeko for portability");
396 # endif
397 #endif
398
399 #ifdef _GL_FSEEK_WARN
400 # undef _GL_FSEEK_WARN
401 /* Here, either fseek is undefined (but C89 guarantees that it is
402    declared), or it is defined as rpl_fseek (declared above).  */
403 _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
404                  "on 32-bit platforms - "
405                  "use fseeko function for handling of large files");
406 #endif
407
408
409 /* ftell, ftello.  See the comments on fseek/fseeko.  */
410
411 #if @GNULIB_FTELL@
412 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
413 #  define _GL_FTELL_WARN /* Category 2, above.  */
414 #  undef ftell
415 # endif
416 # if @REPLACE_FTELL@
417 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
418 #   undef ftell
419 #   define ftell rpl_ftell
420 #  endif
421 _GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
422 _GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
423 # else
424 _GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
425 # endif
426 _GL_CXXALIASWARN (ftell);
427 #endif
428
429 #if @GNULIB_FTELLO@
430 # if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
431 #  define _GL_FTELL_WARN /* Category 3, above.  */
432 #  undef ftell
433 # endif
434 # if @REPLACE_FTELLO@
435 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
436 #   undef ftello
437 #   define ftello rpl_ftello
438 #  endif
439 _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
440 _GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
441 # else
442 #  if ! @HAVE_DECL_FTELLO@
443 _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
444 #  endif
445 _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
446 # endif
447 _GL_CXXALIASWARN (ftello);
448 # if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@
449    /* Provide an ftell function that is consistent with ftello.  */
450    /* In order to avoid that ftell gets defined as a macro here, the
451       developer can request the 'ftell' module.  */
452 #  if !GNULIB_defined_ftell_function
453 #   undef ftell
454 #   define ftell rpl_ftell
455 static inline long _GL_ARG_NONNULL ((1))
456 rpl_ftell (FILE *f)
457 {
458 #   if @REPLACE_FTELLO@
459   return rpl_ftello (f);
460 #   else
461   return ftello (f);
462 #   endif
463 }
464 #   define GNULIB_defined_ftell_function 1
465 #  endif
466 # endif
467 #elif defined GNULIB_POSIXCHECK
468 # define _GL_FTELL_WARN /* Category 1, above.  */
469 # undef ftell
470 # undef ftello
471 # if HAVE_RAW_DECL_FTELLO
472 _GL_WARN_ON_USE (ftello, "ftello is unportable - "
473                  "use gnulib module ftello for portability");
474 # endif
475 #endif
476
477 #ifdef _GL_FTELL_WARN
478 # undef _GL_FTELL_WARN
479 /* Here, either ftell is undefined (but C89 guarantees that it is
480    declared), or it is defined as rpl_ftell (declared above).  */
481 _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
482                  "on 32-bit platforms - "
483                  "use ftello function for handling of large files");
484 #endif
485
486
487 #if @GNULIB_FWRITE@
488 # if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
489 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
490 #   undef fwrite
491 #   define fwrite rpl_fwrite
492 #  endif
493 _GL_FUNCDECL_RPL (fwrite, size_t,
494                   (const void *ptr, size_t s, size_t n, FILE *stream)
495                   _GL_ARG_NONNULL ((1, 4)));
496 _GL_CXXALIAS_RPL (fwrite, size_t,
497                   (const void *ptr, size_t s, size_t n, FILE *stream));
498 # else
499 _GL_CXXALIAS_SYS (fwrite, size_t,
500                   (const void *ptr, size_t s, size_t n, FILE *stream));
501 # endif
502 _GL_CXXALIASWARN (fwrite);
503 #endif
504
505 #if @GNULIB_GETDELIM@
506 /* Read input, up to (and including) the next occurrence of DELIMITER, from
507    STREAM, store it in *LINEPTR (and NUL-terminate it).
508    *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
509    bytes of space.  It is realloc'd as necessary.
510    Return the number of bytes read and stored at *LINEPTR (not including the
511    NUL terminator), or -1 on error or EOF.  */
512 # if @REPLACE_GETDELIM@
513 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
514 #   undef getdelim
515 #   define getdelim rpl_getdelim
516 #  endif
517 _GL_FUNCDECL_RPL (getdelim, ssize_t,
518                   (char **lineptr, size_t *linesize, int delimiter,
519                    FILE *stream)
520                   _GL_ARG_NONNULL ((1, 2, 4)));
521 _GL_CXXALIAS_RPL (getdelim, ssize_t,
522                   (char **lineptr, size_t *linesize, int delimiter,
523                    FILE *stream));
524 # else
525 #  if !@HAVE_DECL_GETDELIM@
526 _GL_FUNCDECL_SYS (getdelim, ssize_t,
527                   (char **lineptr, size_t *linesize, int delimiter,
528                    FILE *stream)
529                   _GL_ARG_NONNULL ((1, 2, 4)));
530 #  endif
531 _GL_CXXALIAS_SYS (getdelim, ssize_t,
532                   (char **lineptr, size_t *linesize, int delimiter,
533                    FILE *stream));
534 # endif
535 _GL_CXXALIASWARN (getdelim);
536 #elif defined GNULIB_POSIXCHECK
537 # undef getdelim
538 # if HAVE_RAW_DECL_GETDELIM
539 _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
540                  "use gnulib module getdelim for portability");
541 # endif
542 #endif
543
544 #if @GNULIB_GETLINE@
545 /* Read a line, up to (and including) the next newline, from STREAM, store it
546    in *LINEPTR (and NUL-terminate it).
547    *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
548    bytes of space.  It is realloc'd as necessary.
549    Return the number of bytes read and stored at *LINEPTR (not including the
550    NUL terminator), or -1 on error or EOF.  */
551 # if @REPLACE_GETLINE@
552 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
553 #   undef getline
554 #   define getline rpl_getline
555 #  endif
556 _GL_FUNCDECL_RPL (getline, ssize_t,
557                   (char **lineptr, size_t *linesize, FILE *stream)
558                   _GL_ARG_NONNULL ((1, 2, 3)));
559 _GL_CXXALIAS_RPL (getline, ssize_t,
560                   (char **lineptr, size_t *linesize, FILE *stream));
561 # else
562 #  if !@HAVE_DECL_GETLINE@
563 _GL_FUNCDECL_SYS (getline, ssize_t,
564                   (char **lineptr, size_t *linesize, FILE *stream)
565                   _GL_ARG_NONNULL ((1, 2, 3)));
566 #  endif
567 _GL_CXXALIAS_SYS (getline, ssize_t,
568                   (char **lineptr, size_t *linesize, FILE *stream));
569 # endif
570 # if @HAVE_DECL_GETLINE@
571 _GL_CXXALIASWARN (getline);
572 # endif
573 #elif defined GNULIB_POSIXCHECK
574 # undef getline
575 # if HAVE_RAW_DECL_GETLINE
576 _GL_WARN_ON_USE (getline, "getline is unportable - "
577                  "use gnulib module getline for portability");
578 # endif
579 #endif
580
581 #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
582 struct obstack;
583 /* Grow an obstack with formatted output.  Return the number of
584    bytes added to OBS.  No trailing nul byte is added, and the
585    object should be closed with obstack_finish before use.  Upon
586    memory allocation error, call obstack_alloc_failed_handler.  Upon
587    other error, return -1.  */
588 # if @REPLACE_OBSTACK_PRINTF@
589 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
590 #   define obstack_printf rpl_obstack_printf
591 #  endif
592 _GL_FUNCDECL_RPL (obstack_printf, int,
593                   (struct obstack *obs, const char *format, ...)
594                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
595                   _GL_ARG_NONNULL ((1, 2)));
596 _GL_CXXALIAS_RPL (obstack_printf, int,
597                   (struct obstack *obs, const char *format, ...));
598 # else
599 #  if !@HAVE_DECL_OBSTACK_PRINTF@
600 _GL_FUNCDECL_SYS (obstack_printf, int,
601                   (struct obstack *obs, const char *format, ...)
602                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
603                   _GL_ARG_NONNULL ((1, 2)));
604 #  endif
605 _GL_CXXALIAS_SYS (obstack_printf, int,
606                   (struct obstack *obs, const char *format, ...));
607 # endif
608 _GL_CXXALIASWARN (obstack_printf);
609 # if @REPLACE_OBSTACK_PRINTF@
610 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
611 #   define obstack_vprintf rpl_obstack_vprintf
612 #  endif
613 _GL_FUNCDECL_RPL (obstack_vprintf, int,
614                   (struct obstack *obs, const char *format, va_list args)
615                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
616                   _GL_ARG_NONNULL ((1, 2)));
617 _GL_CXXALIAS_RPL (obstack_vprintf, int,
618                   (struct obstack *obs, const char *format, va_list args));
619 # else
620 #  if !@HAVE_DECL_OBSTACK_PRINTF@
621 _GL_FUNCDECL_SYS (obstack_vprintf, int,
622                   (struct obstack *obs, const char *format, va_list args)
623                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
624                   _GL_ARG_NONNULL ((1, 2)));
625 #  endif
626 _GL_CXXALIAS_SYS (obstack_vprintf, int,
627                   (struct obstack *obs, const char *format, va_list args));
628 # endif
629 _GL_CXXALIASWARN (obstack_vprintf);
630 #endif
631
632 #if @GNULIB_PERROR@
633 /* Print a message to standard error, describing the value of ERRNO,
634    (if STRING is not NULL and not empty) prefixed with STRING and ": ",
635    and terminated with a newline.  */
636 # if @REPLACE_PERROR@
637 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
638 #   define perror rpl_perror
639 #  endif
640 _GL_FUNCDECL_RPL (perror, void, (const char *string));
641 _GL_CXXALIAS_RPL (perror, void, (const char *string));
642 # else
643 _GL_CXXALIAS_SYS (perror, void, (const char *string));
644 # endif
645 _GL_CXXALIASWARN (perror);
646 #elif defined GNULIB_POSIXCHECK
647 # undef perror
648 /* Assume perror is always declared.  */
649 _GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
650                  "use gnulib module perror for portability");
651 #endif
652
653 #if @GNULIB_POPEN@
654 # if @REPLACE_POPEN@
655 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
656 #   undef popen
657 #   define popen rpl_popen
658 #  endif
659 _GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
660                                  _GL_ARG_NONNULL ((1, 2)));
661 _GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
662 # else
663 _GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
664 # endif
665 _GL_CXXALIASWARN (popen);
666 #elif defined GNULIB_POSIXCHECK
667 # undef popen
668 # if HAVE_RAW_DECL_POPEN
669 _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
670                  "use gnulib module popen or pipe for more portability");
671 # endif
672 #endif
673
674 #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
675 # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
676      || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
677 #  if defined __GNUC__
678 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
679 /* Don't break __attribute__((format(printf,M,N))).  */
680 #    define printf __printf__
681 #   endif
682 _GL_FUNCDECL_RPL_1 (__printf__, int,
683                     (const char *format, ...)
684                     __asm__ (@ASM_SYMBOL_PREFIX@
685                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
686                     _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
687                     _GL_ARG_NONNULL ((1)));
688 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
689 #  else
690 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
691 #    define printf rpl_printf
692 #   endif
693 _GL_FUNCDECL_RPL (printf, int,
694                   (const char *format, ...)
695                   _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
696                   _GL_ARG_NONNULL ((1)));
697 _GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
698 #  endif
699 #  define GNULIB_overrides_printf 1
700 # else
701 _GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
702 # endif
703 _GL_CXXALIASWARN (printf);
704 #endif
705 #if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
706 # if !GNULIB_overrides_printf
707 #  undef printf
708 # endif
709 /* Assume printf is always declared.  */
710 _GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
711                  "use gnulib module printf-posix for portable "
712                  "POSIX compliance");
713 #endif
714
715 #if @GNULIB_PUTC@
716 # if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
717 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
718 #   undef putc
719 #   define putc rpl_fputc
720 #  endif
721 _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
722 _GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
723 # else
724 _GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
725 # endif
726 _GL_CXXALIASWARN (putc);
727 #endif
728
729 #if @GNULIB_PUTCHAR@
730 # if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
731 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
732 #   undef putchar
733 #   define putchar rpl_putchar
734 #  endif
735 _GL_FUNCDECL_RPL (putchar, int, (int c));
736 _GL_CXXALIAS_RPL (putchar, int, (int c));
737 # else
738 _GL_CXXALIAS_SYS (putchar, int, (int c));
739 # endif
740 _GL_CXXALIASWARN (putchar);
741 #endif
742
743 #if @GNULIB_PUTS@
744 # if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
745 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
746 #   undef puts
747 #   define puts rpl_puts
748 #  endif
749 _GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
750 _GL_CXXALIAS_RPL (puts, int, (const char *string));
751 # else
752 _GL_CXXALIAS_SYS (puts, int, (const char *string));
753 # endif
754 _GL_CXXALIASWARN (puts);
755 #endif
756
757 #if @GNULIB_REMOVE@
758 # if @REPLACE_REMOVE@
759 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
760 #   undef remove
761 #   define remove rpl_remove
762 #  endif
763 _GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
764 _GL_CXXALIAS_RPL (remove, int, (const char *name));
765 # else
766 _GL_CXXALIAS_SYS (remove, int, (const char *name));
767 # endif
768 _GL_CXXALIASWARN (remove);
769 #elif defined GNULIB_POSIXCHECK
770 # undef remove
771 /* Assume remove is always declared.  */
772 _GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
773                  "use gnulib module remove for more portability");
774 #endif
775
776 #if @GNULIB_RENAME@
777 # if @REPLACE_RENAME@
778 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
779 #   undef rename
780 #   define rename rpl_rename
781 #  endif
782 _GL_FUNCDECL_RPL (rename, int,
783                   (const char *old_filename, const char *new_filename)
784                   _GL_ARG_NONNULL ((1, 2)));
785 _GL_CXXALIAS_RPL (rename, int,
786                   (const char *old_filename, const char *new_filename));
787 # else
788 _GL_CXXALIAS_SYS (rename, int,
789                   (const char *old_filename, const char *new_filename));
790 # endif
791 _GL_CXXALIASWARN (rename);
792 #elif defined GNULIB_POSIXCHECK
793 # undef rename
794 /* Assume rename is always declared.  */
795 _GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
796                  "use gnulib module rename for more portability");
797 #endif
798
799 #if @GNULIB_RENAMEAT@
800 # if @REPLACE_RENAMEAT@
801 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
802 #   undef renameat
803 #   define renameat rpl_renameat
804 #  endif
805 _GL_FUNCDECL_RPL (renameat, int,
806                   (int fd1, char const *file1, int fd2, char const *file2)
807                   _GL_ARG_NONNULL ((2, 4)));
808 _GL_CXXALIAS_RPL (renameat, int,
809                   (int fd1, char const *file1, int fd2, char const *file2));
810 # else
811 #  if !@HAVE_RENAMEAT@
812 _GL_FUNCDECL_SYS (renameat, int,
813                   (int fd1, char const *file1, int fd2, char const *file2)
814                   _GL_ARG_NONNULL ((2, 4)));
815 #  endif
816 _GL_CXXALIAS_SYS (renameat, int,
817                   (int fd1, char const *file1, int fd2, char const *file2));
818 # endif
819 _GL_CXXALIASWARN (renameat);
820 #elif defined GNULIB_POSIXCHECK
821 # undef renameat
822 # if HAVE_RAW_DECL_RENAMEAT
823 _GL_WARN_ON_USE (renameat, "renameat is not portable - "
824                  "use gnulib module renameat for portability");
825 # endif
826 #endif
827
828 #if @GNULIB_SNPRINTF@
829 # if @REPLACE_SNPRINTF@
830 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
831 #   define snprintf rpl_snprintf
832 #  endif
833 _GL_FUNCDECL_RPL (snprintf, int,
834                   (char *str, size_t size, const char *format, ...)
835                   _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
836                   _GL_ARG_NONNULL ((3)));
837 _GL_CXXALIAS_RPL (snprintf, int,
838                   (char *str, size_t size, const char *format, ...));
839 # else
840 #  if !@HAVE_DECL_SNPRINTF@
841 _GL_FUNCDECL_SYS (snprintf, int,
842                   (char *str, size_t size, const char *format, ...)
843                   _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
844                   _GL_ARG_NONNULL ((3)));
845 #  endif
846 _GL_CXXALIAS_SYS (snprintf, int,
847                   (char *str, size_t size, const char *format, ...));
848 # endif
849 _GL_CXXALIASWARN (snprintf);
850 #elif defined GNULIB_POSIXCHECK
851 # undef snprintf
852 # if HAVE_RAW_DECL_SNPRINTF
853 _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
854                  "use gnulib module snprintf for portability");
855 # endif
856 #endif
857
858 /* Some people would argue that sprintf should be handled like gets
859    (for example, OpenBSD issues a link warning for both functions),
860    since both can cause security holes due to buffer overruns.
861    However, we believe that sprintf can be used safely, and is more
862    efficient than snprintf in those safe cases; and as proof of our
863    belief, we use sprintf in several gnulib modules.  So this header
864    intentionally avoids adding a warning to sprintf except when
865    GNULIB_POSIXCHECK is defined.  */
866
867 #if @GNULIB_SPRINTF_POSIX@
868 # if @REPLACE_SPRINTF@
869 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
870 #   define sprintf rpl_sprintf
871 #  endif
872 _GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
873                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
874                                 _GL_ARG_NONNULL ((1, 2)));
875 _GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
876 # else
877 _GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
878 # endif
879 _GL_CXXALIASWARN (sprintf);
880 #elif defined GNULIB_POSIXCHECK
881 # undef sprintf
882 /* Assume sprintf is always declared.  */
883 _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
884                  "use gnulib module sprintf-posix for portable "
885                  "POSIX compliance");
886 #endif
887
888 #if @GNULIB_TMPFILE@
889 # if @REPLACE_TMPFILE@
890 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
891 #   define tmpfile rpl_tmpfile
892 #  endif
893 _GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
894 _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
895 # else
896 _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
897 # endif
898 _GL_CXXALIASWARN (tmpfile);
899 #elif defined GNULIB_POSIXCHECK
900 # undef tmpfile
901 # if HAVE_RAW_DECL_TMPFILE
902 _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
903                  "use gnulib module tmpfile for portability");
904 # endif
905 #endif
906
907 #if @GNULIB_VASPRINTF@
908 /* Write formatted output to a string dynamically allocated with malloc().
909    If the memory allocation succeeds, store the address of the string in
910    *RESULT and return the number of resulting bytes, excluding the trailing
911    NUL.  Upon memory allocation error, or some other error, return -1.  */
912 # if @REPLACE_VASPRINTF@
913 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
914 #   define asprintf rpl_asprintf
915 #  endif
916 _GL_FUNCDECL_RPL (asprintf, int,
917                   (char **result, const char *format, ...)
918                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
919                   _GL_ARG_NONNULL ((1, 2)));
920 _GL_CXXALIAS_RPL (asprintf, int,
921                   (char **result, const char *format, ...));
922 # else
923 #  if !@HAVE_VASPRINTF@
924 _GL_FUNCDECL_SYS (asprintf, int,
925                   (char **result, const char *format, ...)
926                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
927                   _GL_ARG_NONNULL ((1, 2)));
928 #  endif
929 _GL_CXXALIAS_SYS (asprintf, int,
930                   (char **result, const char *format, ...));
931 # endif
932 _GL_CXXALIASWARN (asprintf);
933 # if @REPLACE_VASPRINTF@
934 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
935 #   define vasprintf rpl_vasprintf
936 #  endif
937 _GL_FUNCDECL_RPL (vasprintf, int,
938                   (char **result, const char *format, va_list args)
939                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
940                   _GL_ARG_NONNULL ((1, 2)));
941 _GL_CXXALIAS_RPL (vasprintf, int,
942                   (char **result, const char *format, va_list args));
943 # else
944 #  if !@HAVE_VASPRINTF@
945 _GL_FUNCDECL_SYS (vasprintf, int,
946                   (char **result, const char *format, va_list args)
947                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
948                   _GL_ARG_NONNULL ((1, 2)));
949 #  endif
950 _GL_CXXALIAS_SYS (vasprintf, int,
951                   (char **result, const char *format, va_list args));
952 # endif
953 _GL_CXXALIASWARN (vasprintf);
954 #endif
955
956 #if @GNULIB_VDPRINTF@
957 # if @REPLACE_VDPRINTF@
958 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
959 #   define vdprintf rpl_vdprintf
960 #  endif
961 _GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
962                                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
963                                  _GL_ARG_NONNULL ((2)));
964 _GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
965 # else
966 #  if !@HAVE_VDPRINTF@
967 _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
968                                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
969                                  _GL_ARG_NONNULL ((2)));
970 #  endif
971 /* Need to cast, because on Solaris, the third parameter will likely be
972                                                     __va_list args.  */
973 _GL_CXXALIAS_SYS_CAST (vdprintf, int,
974                        (int fd, const char *format, va_list args));
975 # endif
976 _GL_CXXALIASWARN (vdprintf);
977 #elif defined GNULIB_POSIXCHECK
978 # undef vdprintf
979 # if HAVE_RAW_DECL_VDPRINTF
980 _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
981                  "use gnulib module vdprintf for portability");
982 # endif
983 #endif
984
985 #if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
986 # if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
987      || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
988 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
989 #   define vfprintf rpl_vfprintf
990 #  endif
991 #  define GNULIB_overrides_vfprintf 1
992 _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
993                                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
994                                  _GL_ARG_NONNULL ((1, 2)));
995 _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
996 # else
997 /* Need to cast, because on Solaris, the third parameter is
998                                                       __va_list args
999    and GCC's fixincludes did not change this to __gnuc_va_list.  */
1000 _GL_CXXALIAS_SYS_CAST (vfprintf, int,
1001                        (FILE *fp, const char *format, va_list args));
1002 # endif
1003 _GL_CXXALIASWARN (vfprintf);
1004 #endif
1005 #if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
1006 # if !GNULIB_overrides_vfprintf
1007 #  undef vfprintf
1008 # endif
1009 /* Assume vfprintf is always declared.  */
1010 _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
1011                  "use gnulib module vfprintf-posix for portable "
1012                       "POSIX compliance");
1013 #endif
1014
1015 #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
1016 # if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
1017      || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
1018 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1019 #   define vprintf rpl_vprintf
1020 #  endif
1021 #  define GNULIB_overrides_vprintf 1
1022 _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
1023                                 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
1024                                 _GL_ARG_NONNULL ((1)));
1025 _GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
1026 # else
1027 /* Need to cast, because on Solaris, the second parameter is
1028                                                           __va_list args
1029    and GCC's fixincludes did not change this to __gnuc_va_list.  */
1030 _GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
1031 # endif
1032 _GL_CXXALIASWARN (vprintf);
1033 #endif
1034 #if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
1035 # if !GNULIB_overrides_vprintf
1036 #  undef vprintf
1037 # endif
1038 /* Assume vprintf is always declared.  */
1039 _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
1040                  "use gnulib module vprintf-posix for portable "
1041                  "POSIX compliance");
1042 #endif
1043
1044 #if @GNULIB_VSNPRINTF@
1045 # if @REPLACE_VSNPRINTF@
1046 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1047 #   define vsnprintf rpl_vsnprintf
1048 #  endif
1049 _GL_FUNCDECL_RPL (vsnprintf, int,
1050                   (char *str, size_t size, const char *format, va_list args)
1051                   _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1052                   _GL_ARG_NONNULL ((3)));
1053 _GL_CXXALIAS_RPL (vsnprintf, int,
1054                   (char *str, size_t size, const char *format, va_list args));
1055 # else
1056 #  if !@HAVE_DECL_VSNPRINTF@
1057 _GL_FUNCDECL_SYS (vsnprintf, int,
1058                   (char *str, size_t size, const char *format, va_list args)
1059                   _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1060                   _GL_ARG_NONNULL ((3)));
1061 #  endif
1062 _GL_CXXALIAS_SYS (vsnprintf, int,
1063                   (char *str, size_t size, const char *format, va_list args));
1064 # endif
1065 _GL_CXXALIASWARN (vsnprintf);
1066 #elif defined GNULIB_POSIXCHECK
1067 # undef vsnprintf
1068 # if HAVE_RAW_DECL_VSNPRINTF
1069 _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
1070                  "use gnulib module vsnprintf for portability");
1071 # endif
1072 #endif
1073
1074 #if @GNULIB_VSPRINTF_POSIX@
1075 # if @REPLACE_VSPRINTF@
1076 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1077 #   define vsprintf rpl_vsprintf
1078 #  endif
1079 _GL_FUNCDECL_RPL (vsprintf, int,
1080                   (char *str, const char *format, va_list args)
1081                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1082                   _GL_ARG_NONNULL ((1, 2)));
1083 _GL_CXXALIAS_RPL (vsprintf, int,
1084                   (char *str, const char *format, va_list args));
1085 # else
1086 /* Need to cast, because on Solaris, the third parameter is
1087                                                        __va_list args
1088    and GCC's fixincludes did not change this to __gnuc_va_list.  */
1089 _GL_CXXALIAS_SYS_CAST (vsprintf, int,
1090                        (char *str, const char *format, va_list args));
1091 # endif
1092 _GL_CXXALIASWARN (vsprintf);
1093 #elif defined GNULIB_POSIXCHECK
1094 # undef vsprintf
1095 /* Assume vsprintf is always declared.  */
1096 _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
1097                  "use gnulib module vsprintf-posix for portable "
1098                       "POSIX compliance");
1099 #endif
1100
1101
1102 #endif /* _GL_STDIO_H */
1103 #endif /* _GL_STDIO_H */
1104 #endif