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