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