Annotation of embedaddon/libiconv/srclib/stdio.in.h, revision 1.1.1.3

1.1       misho       1: /* A GNU-like <stdio.h>.
                      2: 
1.1.1.3 ! misho       3:    Copyright (C) 2004, 2007-2019 Free Software Foundation, Inc.
1.1       misho       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 3, 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
1.1.1.3 ! misho      16:    along with this program; if not, see <https://www.gnu.org/licenses/>.  */
1.1       misho      17: 
                     18: #if __GNUC__ >= 3
                     19: @PRAGMA_SYSTEM_HEADER@
                     20: #endif
1.1.1.2   misho      21: @PRAGMA_COLUMNS@
1.1       misho      22: 
1.1.1.2   misho      23: #if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
                     24: /* Special invocation convention:
                     25:    - Inside glibc header files.
                     26:    - On OSF/1 5.1 we have a sequence of nested includes
                     27:      <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
                     28:      <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
                     29:      In this situation, the functions are not yet declared, therefore we cannot
                     30:      provide the C++ aliases.  */
1.1       misho      31: 
                     32: #@INCLUDE_NEXT@ @NEXT_STDIO_H@
                     33: 
                     34: #else
                     35: /* Normal invocation convention.  */
                     36: 
1.1.1.2   misho      37: #ifndef _@GUARD_PREFIX@_STDIO_H
                     38: 
                     39: #define _GL_ALREADY_INCLUDING_STDIO_H
1.1       misho      40: 
                     41: /* The include_next requires a split double-inclusion guard.  */
                     42: #@INCLUDE_NEXT@ @NEXT_STDIO_H@
                     43: 
1.1.1.2   misho      44: #undef _GL_ALREADY_INCLUDING_STDIO_H
                     45: 
                     46: #ifndef _@GUARD_PREFIX@_STDIO_H
                     47: #define _@GUARD_PREFIX@_STDIO_H
1.1       misho      48: 
1.1.1.2   misho      49: /* Get va_list.  Needed on many systems, including glibc 2.8.  */
1.1       misho      50: #include <stdarg.h>
1.1.1.2   misho      51: 
1.1       misho      52: #include <stddef.h>
                     53: 
1.1.1.2   misho      54: /* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8
1.1.1.3 ! misho      55:    and eglibc 2.11.2.
        !            56:    May also define off_t to a 64-bit type on native Windows.  */
1.1.1.2   misho      57: #include <sys/types.h>
                     58: 
                     59: /* The __attribute__ feature is available in gcc versions 2.5 and later.
                     60:    The __-protected variants of the attributes 'format' and 'printf' are
                     61:    accepted by gcc versions 2.6.4 (effectively 2.7) and later.
                     62:    We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
                     63:    gnulib and libintl do '#define printf __printf__' when they override
                     64:    the 'printf' function.  */
                     65: #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
                     66: # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
                     67: #else
                     68: # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
1.1       misho      69: #endif
                     70: 
1.1.1.2   misho      71: /* _GL_ATTRIBUTE_FORMAT_PRINTF
                     72:    indicates to GCC that the function takes a format string and arguments,
                     73:    where the format string directives are the ones standardized by ISO C99
                     74:    and POSIX.  */
                     75: #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
                     76: # define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
                     77:    _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
                     78: #else
                     79: # define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
                     80:    _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
1.1       misho      81: #endif
                     82: 
1.1.1.2   misho      83: /* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
                     84:    except that it indicates to GCC that the supported format string directives
                     85:    are the ones of the system printf(), rather than the ones standardized by
                     86:    ISO C99 and POSIX.  */
1.1.1.3 ! misho      87: #if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
        !            88: # define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
        !            89:   _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument)
        !            90: #else
        !            91: # define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
1.1.1.2   misho      92:   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
1.1.1.3 ! misho      93: #endif
1.1.1.2   misho      94: 
                     95: /* _GL_ATTRIBUTE_FORMAT_SCANF
                     96:    indicates to GCC that the function takes a format string and arguments,
                     97:    where the format string directives are the ones standardized by ISO C99
                     98:    and POSIX.  */
                     99: #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
                    100: # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
                    101:    _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
                    102: #else
                    103: # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
                    104:    _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
                    105: #endif
1.1       misho     106: 
1.1.1.2   misho     107: /* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
                    108:    except that it indicates to GCC that the supported format string directives
                    109:    are the ones of the system scanf(), rather than the ones standardized by
                    110:    ISO C99 and POSIX.  */
                    111: #define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
                    112:   _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
1.1       misho     113: 
1.1.1.3 ! misho     114: /* Solaris 10 and NetBSD 7.0 declare renameat in <unistd.h>, not in <stdio.h>.  */
1.1.1.2   misho     115: /* But in any case avoid namespace pollution on glibc systems.  */
1.1.1.3 ! misho     116: #if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && (defined __sun || defined __NetBSD__) \
1.1.1.2   misho     117:     && ! defined __GLIBC__
                    118: # include <unistd.h>
1.1       misho     119: #endif
                    120: 
1.1.1.3 ! misho     121: /* Android 4.3 declares renameat in <sys/stat.h>, not in <stdio.h>.  */
        !           122: /* But in any case avoid namespace pollution on glibc systems.  */
        !           123: #if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
        !           124:     && ! defined __GLIBC__
        !           125: # include <sys/stat.h>
        !           126: #endif
        !           127: 
        !           128: /* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>.  We must include
        !           129:    it before we  #define perror rpl_perror.  */
        !           130: /* But in any case avoid namespace pollution on glibc systems.  */
        !           131: #if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
        !           132:     && (defined _WIN32 && ! defined __CYGWIN__) \
        !           133:     && ! defined __GLIBC__
        !           134: # include <stdlib.h>
        !           135: #endif
        !           136: 
        !           137: /* MSVC declares 'remove' in <io.h>, not in <stdio.h>.  We must include
        !           138:    it before we  #define remove rpl_remove.  */
        !           139: /* MSVC declares 'rename' in <io.h>, not in <stdio.h>.  We must include
        !           140:    it before we  #define rename rpl_rename.  */
        !           141: /* But in any case avoid namespace pollution on glibc systems.  */
        !           142: #if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
        !           143:     && (defined _WIN32 && ! defined __CYGWIN__) \
        !           144:     && ! defined __GLIBC__
        !           145: # include <io.h>
        !           146: #endif
        !           147: 
1.1       misho     148: 
1.1.1.2   misho     149: /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
                    150: 
                    151: /* The definition of _GL_ARG_NONNULL is copied here.  */
                    152: 
                    153: /* The definition of _GL_WARN_ON_USE is copied here.  */
                    154: 
                    155: /* Macros for stringification.  */
                    156: #define _GL_STDIO_STRINGIZE(token) #token
                    157: #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
                    158: 
1.1.1.3 ! misho     159: /* When also using extern inline, suppress the use of static inline in
        !           160:    standard headers of problematic Apple configurations, as Libc at
        !           161:    least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
        !           162:    <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
        !           163:    Perhaps Apple will fix this some day.  */
        !           164: #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
        !           165:      && defined __GNUC__ && defined __STDC__)
        !           166: # undef putc_unlocked
        !           167: #endif
1.1       misho     168: 
1.1.1.2   misho     169: #if @GNULIB_DPRINTF@
                    170: # if @REPLACE_DPRINTF@
                    171: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    172: #   define dprintf rpl_dprintf
                    173: #  endif
                    174: _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
                    175:                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                    176:                                 _GL_ARG_NONNULL ((2)));
                    177: _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
                    178: # else
                    179: #  if !@HAVE_DPRINTF@
                    180: _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
                    181:                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                    182:                                 _GL_ARG_NONNULL ((2)));
                    183: #  endif
                    184: _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
1.1       misho     185: # endif
1.1.1.2   misho     186: _GL_CXXALIASWARN (dprintf);
1.1       misho     187: #elif defined GNULIB_POSIXCHECK
1.1.1.2   misho     188: # undef dprintf
                    189: # if HAVE_RAW_DECL_DPRINTF
                    190: _GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
                    191:                  "use gnulib module dprintf for portability");
1.1       misho     192: # endif
                    193: #endif
                    194: 
1.1.1.2   misho     195: #if @GNULIB_FCLOSE@
                    196: /* Close STREAM and its underlying file descriptor.  */
                    197: # if @REPLACE_FCLOSE@
                    198: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    199: #   define fclose rpl_fclose
                    200: #  endif
                    201: _GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
                    202: _GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
                    203: # else
                    204: _GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
1.1       misho     205: # endif
1.1.1.2   misho     206: _GL_CXXALIASWARN (fclose);
1.1       misho     207: #elif defined GNULIB_POSIXCHECK
1.1.1.2   misho     208: # undef fclose
                    209: /* Assume fclose is always declared.  */
                    210: _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
                    211:                  "use gnulib module fclose for portable POSIX compliance");
1.1       misho     212: #endif
                    213: 
1.1.1.3 ! misho     214: #if @GNULIB_FDOPEN@
        !           215: # if @REPLACE_FDOPEN@
        !           216: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
        !           217: #   undef fdopen
        !           218: #   define fdopen rpl_fdopen
        !           219: #  endif
        !           220: _GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
        !           221:                                   _GL_ARG_NONNULL ((2)));
        !           222: _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
        !           223: # else
        !           224: _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
        !           225: # endif
        !           226: _GL_CXXALIASWARN (fdopen);
        !           227: #elif defined GNULIB_POSIXCHECK
        !           228: # undef fdopen
        !           229: /* Assume fdopen is always declared.  */
        !           230: _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
        !           231:                  "use gnulib module fdopen for portability");
        !           232: #endif
        !           233: 
1.1.1.2   misho     234: #if @GNULIB_FFLUSH@
                    235: /* Flush all pending data on STREAM according to POSIX rules.  Both
                    236:    output and seekable input streams are supported.
                    237:    Note! LOSS OF DATA can occur if fflush is applied on an input stream
                    238:    that is _not_seekable_ or on an update stream that is _not_seekable_
                    239:    and in which the most recent operation was input.  Seekability can
                    240:    be tested with lseek(fileno(fp),0,SEEK_CUR).  */
                    241: # if @REPLACE_FFLUSH@
                    242: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    243: #   define fflush rpl_fflush
                    244: #  endif
                    245: _GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
                    246: _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
                    247: # else
                    248: _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
1.1       misho     249: # endif
1.1.1.2   misho     250: _GL_CXXALIASWARN (fflush);
1.1       misho     251: #elif defined GNULIB_POSIXCHECK
1.1.1.2   misho     252: # undef fflush
                    253: /* Assume fflush is always declared.  */
                    254: _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
                    255:                  "use gnulib module fflush for portable POSIX compliance");
1.1       misho     256: #endif
                    257: 
1.1.1.2   misho     258: #if @GNULIB_FGETC@
                    259: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                    260: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    261: #   undef fgetc
                    262: #   define fgetc rpl_fgetc
                    263: #  endif
                    264: _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
                    265: _GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
                    266: # else
                    267: _GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
1.1       misho     268: # endif
1.1.1.2   misho     269: _GL_CXXALIASWARN (fgetc);
1.1       misho     270: #endif
                    271: 
1.1.1.2   misho     272: #if @GNULIB_FGETS@
                    273: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                    274: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    275: #   undef fgets
                    276: #   define fgets rpl_fgets
                    277: #  endif
                    278: _GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
                    279:                                  _GL_ARG_NONNULL ((1, 3)));
                    280: _GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
                    281: # else
                    282: _GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
1.1       misho     283: # endif
1.1.1.2   misho     284: _GL_CXXALIASWARN (fgets);
1.1       misho     285: #endif
                    286: 
1.1.1.2   misho     287: #if @GNULIB_FOPEN@
                    288: # if @REPLACE_FOPEN@
                    289: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    290: #   undef fopen
                    291: #   define fopen rpl_fopen
                    292: #  endif
                    293: _GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
                    294:                                  _GL_ARG_NONNULL ((1, 2)));
                    295: _GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
                    296: # else
                    297: _GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
1.1       misho     298: # endif
1.1.1.2   misho     299: _GL_CXXALIASWARN (fopen);
1.1       misho     300: #elif defined GNULIB_POSIXCHECK
1.1.1.2   misho     301: # undef fopen
                    302: /* Assume fopen is always declared.  */
1.1.1.3 ! misho     303: _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
1.1.1.2   misho     304:                  "use gnulib module fopen for portability");
                    305: #endif
                    306: 
                    307: #if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
                    308: # if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
                    309:      || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
                    310: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    311: #   define fprintf rpl_fprintf
                    312: #  endif
                    313: #  define GNULIB_overrides_fprintf 1
                    314: #  if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
                    315: _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
                    316:                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                    317:                                 _GL_ARG_NONNULL ((1, 2)));
                    318: #  else
                    319: _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
                    320:                                 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
                    321:                                 _GL_ARG_NONNULL ((1, 2)));
                    322: #  endif
                    323: _GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
                    324: # else
                    325: _GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
                    326: # endif
                    327: _GL_CXXALIASWARN (fprintf);
                    328: #endif
                    329: #if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
                    330: # if !GNULIB_overrides_fprintf
                    331: #  undef fprintf
                    332: # endif
                    333: /* Assume fprintf is always declared.  */
                    334: _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
                    335:                  "use gnulib module fprintf-posix for portable "
                    336:                  "POSIX compliance");
1.1       misho     337: #endif
                    338: 
1.1.1.2   misho     339: #if @GNULIB_FPURGE@
                    340: /* Discard all pending buffered I/O data on STREAM.
                    341:    STREAM must not be wide-character oriented.
                    342:    When discarding pending output, the file position is set back to where it
                    343:    was before the write calls.  When discarding pending input, the file
                    344:    position is advanced to match the end of the previously read input.
                    345:    Return 0 if successful.  Upon error, return -1 and set errno.  */
                    346: # if @REPLACE_FPURGE@
                    347: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    348: #   define fpurge rpl_fpurge
                    349: #  endif
                    350: _GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
                    351: _GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
                    352: # else
                    353: #  if !@HAVE_DECL_FPURGE@
                    354: _GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
                    355: #  endif
                    356: _GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
1.1       misho     357: # endif
1.1.1.2   misho     358: _GL_CXXALIASWARN (fpurge);
1.1       misho     359: #elif defined GNULIB_POSIXCHECK
1.1.1.2   misho     360: # undef fpurge
                    361: # if HAVE_RAW_DECL_FPURGE
                    362: _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
                    363:                  "use gnulib module fpurge for portability");
                    364: # endif
1.1       misho     365: #endif
                    366: 
1.1.1.2   misho     367: #if @GNULIB_FPUTC@
                    368: # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
                    369: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    370: #   undef fputc
                    371: #   define fputc rpl_fputc
                    372: #  endif
                    373: _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
                    374: _GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
                    375: # else
                    376: _GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
1.1       misho     377: # endif
1.1.1.2   misho     378: _GL_CXXALIASWARN (fputc);
1.1       misho     379: #endif
                    380: 
1.1.1.2   misho     381: #if @GNULIB_FPUTS@
                    382: # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
                    383: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    384: #   undef fputs
                    385: #   define fputs rpl_fputs
                    386: #  endif
                    387: _GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
                    388:                               _GL_ARG_NONNULL ((1, 2)));
                    389: _GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
                    390: # else
                    391: _GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
1.1       misho     392: # endif
1.1.1.2   misho     393: _GL_CXXALIASWARN (fputs);
1.1       misho     394: #endif
                    395: 
1.1.1.2   misho     396: #if @GNULIB_FREAD@
                    397: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                    398: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    399: #   undef fread
                    400: #   define fread rpl_fread
                    401: #  endif
                    402: _GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
                    403:                                  _GL_ARG_NONNULL ((4)));
                    404: _GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
                    405: # else
                    406: _GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
1.1       misho     407: # endif
1.1.1.2   misho     408: _GL_CXXALIASWARN (fread);
1.1       misho     409: #endif
                    410: 
                    411: #if @GNULIB_FREOPEN@
                    412: # if @REPLACE_FREOPEN@
1.1.1.2   misho     413: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    414: #   undef freopen
                    415: #   define freopen rpl_freopen
                    416: #  endif
                    417: _GL_FUNCDECL_RPL (freopen, FILE *,
                    418:                   (const char *filename, const char *mode, FILE *stream)
                    419:                   _GL_ARG_NONNULL ((2, 3)));
                    420: _GL_CXXALIAS_RPL (freopen, FILE *,
                    421:                   (const char *filename, const char *mode, FILE *stream));
                    422: # else
                    423: _GL_CXXALIAS_SYS (freopen, FILE *,
                    424:                   (const char *filename, const char *mode, FILE *stream));
1.1       misho     425: # endif
1.1.1.2   misho     426: _GL_CXXALIASWARN (freopen);
1.1       misho     427: #elif defined GNULIB_POSIXCHECK
                    428: # undef freopen
1.1.1.2   misho     429: /* Assume freopen is always declared.  */
                    430: _GL_WARN_ON_USE (freopen,
1.1.1.3 ! misho     431:                  "freopen on native Windows platforms is not POSIX compliant - "
1.1.1.2   misho     432:                  "use gnulib module freopen for portability");
                    433: #endif
                    434: 
                    435: #if @GNULIB_FSCANF@
                    436: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                    437: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    438: #   undef fscanf
                    439: #   define fscanf rpl_fscanf
                    440: #  endif
                    441: _GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
                    442:                                _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
                    443:                                _GL_ARG_NONNULL ((1, 2)));
                    444: _GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
                    445: # else
                    446: _GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
                    447: # endif
                    448: _GL_CXXALIASWARN (fscanf);
                    449: #endif
                    450: 
                    451: 
                    452: /* Set up the following warnings, based on which modules are in use.
                    453:    GNU Coding Standards discourage the use of fseek, since it imposes
                    454:    an arbitrary limitation on some 32-bit hosts.  Remember that the
                    455:    fseek module depends on the fseeko module, so we only have three
                    456:    cases to consider:
                    457: 
                    458:    1. The developer is not using either module.  Issue a warning under
                    459:    GNULIB_POSIXCHECK for both functions, to remind them that both
                    460:    functions have bugs on some systems.  _GL_NO_LARGE_FILES has no
                    461:    impact on this warning.
                    462: 
                    463:    2. The developer is using both modules.  They may be unaware of the
                    464:    arbitrary limitations of fseek, so issue a warning under
                    465:    GNULIB_POSIXCHECK.  On the other hand, they may be using both
                    466:    modules intentionally, so the developer can define
                    467:    _GL_NO_LARGE_FILES in the compilation units where the use of fseek
                    468:    is safe, to silence the warning.
                    469: 
                    470:    3. The developer is using the fseeko module, but not fseek.  Gnulib
                    471:    guarantees that fseek will still work around platform bugs in that
                    472:    case, but we presume that the developer is aware of the pitfalls of
                    473:    fseek and was trying to avoid it, so issue a warning even when
                    474:    GNULIB_POSIXCHECK is undefined.  Again, _GL_NO_LARGE_FILES can be
                    475:    defined to silence the warning in particular compilation units.
                    476:    In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
                    477:    fseek gets defined as a macro, it is recommended that the developer
                    478:    uses the fseek module, even if he is not calling the fseek function.
                    479: 
                    480:    Most gnulib clients that perform stream operations should fall into
                    481:    category 3.  */
                    482: 
                    483: #if @GNULIB_FSEEK@
                    484: # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
                    485: #  define _GL_FSEEK_WARN /* Category 2, above.  */
                    486: #  undef fseek
                    487: # endif
                    488: # if @REPLACE_FSEEK@
                    489: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    490: #   undef fseek
                    491: #   define fseek rpl_fseek
                    492: #  endif
                    493: _GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
                    494:                               _GL_ARG_NONNULL ((1)));
                    495: _GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
                    496: # else
                    497: _GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
                    498: # endif
                    499: _GL_CXXALIASWARN (fseek);
1.1       misho     500: #endif
                    501: 
                    502: #if @GNULIB_FSEEKO@
1.1.1.2   misho     503: # if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
                    504: #  define _GL_FSEEK_WARN /* Category 3, above.  */
                    505: #  undef fseek
                    506: # endif
1.1       misho     507: # if @REPLACE_FSEEKO@
1.1.1.2   misho     508: /* Provide an fseeko function that is aware of a preceding fflush(), and which
                    509:    detects pipes.  */
                    510: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    511: #   undef fseeko
                    512: #   define fseeko rpl_fseeko
                    513: #  endif
                    514: _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
                    515:                                _GL_ARG_NONNULL ((1)));
                    516: _GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
                    517: # else
                    518: #  if ! @HAVE_DECL_FSEEKO@
                    519: _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
                    520:                                _GL_ARG_NONNULL ((1)));
                    521: #  endif
                    522: _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
1.1       misho     523: # endif
1.1.1.2   misho     524: _GL_CXXALIASWARN (fseeko);
1.1       misho     525: #elif defined GNULIB_POSIXCHECK
1.1.1.2   misho     526: # define _GL_FSEEK_WARN /* Category 1, above.  */
1.1       misho     527: # undef fseek
1.1.1.2   misho     528: # undef fseeko
                    529: # if HAVE_RAW_DECL_FSEEKO
                    530: _GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
                    531:                  "use gnulib module fseeko for portability");
1.1       misho     532: # endif
                    533: #endif
                    534: 
1.1.1.2   misho     535: #ifdef _GL_FSEEK_WARN
                    536: # undef _GL_FSEEK_WARN
                    537: /* Here, either fseek is undefined (but C89 guarantees that it is
                    538:    declared), or it is defined as rpl_fseek (declared above).  */
                    539: _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
                    540:                  "on 32-bit platforms - "
                    541:                  "use fseeko function for handling of large files");
1.1       misho     542: #endif
                    543: 
                    544: 
1.1.1.2   misho     545: /* ftell, ftello.  See the comments on fseek/fseeko.  */
1.1       misho     546: 
1.1.1.2   misho     547: #if @GNULIB_FTELL@
                    548: # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
                    549: #  define _GL_FTELL_WARN /* Category 2, above.  */
                    550: #  undef ftell
1.1       misho     551: # endif
1.1.1.2   misho     552: # if @REPLACE_FTELL@
                    553: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    554: #   undef ftell
                    555: #   define ftell rpl_ftell
                    556: #  endif
                    557: _GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
                    558: _GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
                    559: # else
                    560: _GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
1.1       misho     561: # endif
1.1.1.2   misho     562: _GL_CXXALIASWARN (ftell);
1.1       misho     563: #endif
                    564: 
1.1.1.2   misho     565: #if @GNULIB_FTELLO@
                    566: # if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
                    567: #  define _GL_FTELL_WARN /* Category 3, above.  */
                    568: #  undef ftell
1.1       misho     569: # endif
1.1.1.2   misho     570: # if @REPLACE_FTELLO@
                    571: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    572: #   undef ftello
                    573: #   define ftello rpl_ftello
                    574: #  endif
                    575: _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
                    576: _GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
                    577: # else
                    578: #  if ! @HAVE_DECL_FTELLO@
                    579: _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
                    580: #  endif
                    581: _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
                    582: # endif
                    583: _GL_CXXALIASWARN (ftello);
1.1       misho     584: #elif defined GNULIB_POSIXCHECK
1.1.1.2   misho     585: # define _GL_FTELL_WARN /* Category 1, above.  */
                    586: # undef ftell
                    587: # undef ftello
                    588: # if HAVE_RAW_DECL_FTELLO
                    589: _GL_WARN_ON_USE (ftello, "ftello is unportable - "
                    590:                  "use gnulib module ftello for portability");
                    591: # endif
1.1       misho     592: #endif
                    593: 
1.1.1.2   misho     594: #ifdef _GL_FTELL_WARN
                    595: # undef _GL_FTELL_WARN
                    596: /* Here, either ftell is undefined (but C89 guarantees that it is
                    597:    declared), or it is defined as rpl_ftell (declared above).  */
                    598: _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
                    599:                  "on 32-bit platforms - "
                    600:                  "use ftello function for handling of large files");
1.1       misho     601: #endif
                    602: 
                    603: 
1.1.1.2   misho     604: #if @GNULIB_FWRITE@
                    605: # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
                    606: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    607: #   undef fwrite
                    608: #   define fwrite rpl_fwrite
                    609: #  endif
                    610: _GL_FUNCDECL_RPL (fwrite, size_t,
                    611:                   (const void *ptr, size_t s, size_t n, FILE *stream)
                    612:                   _GL_ARG_NONNULL ((1, 4)));
                    613: _GL_CXXALIAS_RPL (fwrite, size_t,
                    614:                   (const void *ptr, size_t s, size_t n, FILE *stream));
                    615: # else
                    616: _GL_CXXALIAS_SYS (fwrite, size_t,
                    617:                   (const void *ptr, size_t s, size_t n, FILE *stream));
1.1       misho     618: 
1.1.1.3 ! misho     619: /* Work around bug 11959 when fortifying glibc 2.4 through 2.15
        !           620:    <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>,
1.1.1.2   misho     621:    which sometimes causes an unwanted diagnostic for fwrite calls.
1.1.1.3 ! misho     622:    This affects only function declaration attributes under certain
        !           623:    versions of gcc and clang, and is not needed for C++.  */
        !           624: #  if (0 < __USE_FORTIFY_LEVEL                                          \
        !           625:        && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
        !           626:        && 3 < __GNUC__ + (4 <= __GNUC_MINOR__)                          \
        !           627:        && !defined __cplusplus)
1.1.1.2   misho     628: #   undef fwrite
1.1.1.3 ! misho     629: #   undef fwrite_unlocked
        !           630: extern size_t __REDIRECT (rpl_fwrite,
        !           631:                           (const void *__restrict, size_t, size_t,
        !           632:                            FILE *__restrict),
        !           633:                           fwrite);
        !           634: extern size_t __REDIRECT (rpl_fwrite_unlocked,
        !           635:                           (const void *__restrict, size_t, size_t,
        !           636:                            FILE *__restrict),
        !           637:                           fwrite_unlocked);
1.1.1.2   misho     638: #   define fwrite rpl_fwrite
1.1.1.3 ! misho     639: #   define fwrite_unlocked rpl_fwrite_unlocked
1.1.1.2   misho     640: #  endif
                    641: # endif
                    642: _GL_CXXALIASWARN (fwrite);
1.1       misho     643: #endif
                    644: 
1.1.1.2   misho     645: #if @GNULIB_GETC@
                    646: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                    647: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    648: #   undef getc
                    649: #   define getc rpl_fgetc
                    650: #  endif
                    651: _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
                    652: _GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
                    653: # else
                    654: _GL_CXXALIAS_SYS (getc, int, (FILE *stream));
                    655: # endif
                    656: _GL_CXXALIASWARN (getc);
1.1       misho     657: #endif
                    658: 
1.1.1.2   misho     659: #if @GNULIB_GETCHAR@
                    660: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                    661: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    662: #   undef getchar
                    663: #   define getchar rpl_getchar
                    664: #  endif
                    665: _GL_FUNCDECL_RPL (getchar, int, (void));
                    666: _GL_CXXALIAS_RPL (getchar, int, (void));
                    667: # else
                    668: _GL_CXXALIAS_SYS (getchar, int, (void));
                    669: # endif
                    670: _GL_CXXALIASWARN (getchar);
1.1       misho     671: #endif
                    672: 
                    673: #if @GNULIB_GETDELIM@
                    674: /* Read input, up to (and including) the next occurrence of DELIMITER, from
                    675:    STREAM, store it in *LINEPTR (and NUL-terminate it).
                    676:    *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
                    677:    bytes of space.  It is realloc'd as necessary.
                    678:    Return the number of bytes read and stored at *LINEPTR (not including the
                    679:    NUL terminator), or -1 on error or EOF.  */
1.1.1.2   misho     680: # if @REPLACE_GETDELIM@
                    681: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    682: #   undef getdelim
                    683: #   define getdelim rpl_getdelim
                    684: #  endif
                    685: _GL_FUNCDECL_RPL (getdelim, ssize_t,
                    686:                   (char **lineptr, size_t *linesize, int delimiter,
                    687:                    FILE *stream)
                    688:                   _GL_ARG_NONNULL ((1, 2, 4)));
                    689: _GL_CXXALIAS_RPL (getdelim, ssize_t,
                    690:                   (char **lineptr, size_t *linesize, int delimiter,
                    691:                    FILE *stream));
                    692: # else
                    693: #  if !@HAVE_DECL_GETDELIM@
                    694: _GL_FUNCDECL_SYS (getdelim, ssize_t,
                    695:                   (char **lineptr, size_t *linesize, int delimiter,
                    696:                    FILE *stream)
                    697:                   _GL_ARG_NONNULL ((1, 2, 4)));
                    698: #  endif
                    699: _GL_CXXALIAS_SYS (getdelim, ssize_t,
                    700:                   (char **lineptr, size_t *linesize, int delimiter,
                    701:                    FILE *stream));
1.1       misho     702: # endif
1.1.1.2   misho     703: _GL_CXXALIASWARN (getdelim);
1.1       misho     704: #elif defined GNULIB_POSIXCHECK
                    705: # undef getdelim
1.1.1.2   misho     706: # if HAVE_RAW_DECL_GETDELIM
                    707: _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
                    708:                  "use gnulib module getdelim for portability");
                    709: # endif
1.1       misho     710: #endif
                    711: 
                    712: #if @GNULIB_GETLINE@
                    713: /* Read a line, up to (and including) the next newline, from STREAM, store it
                    714:    in *LINEPTR (and NUL-terminate it).
                    715:    *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
                    716:    bytes of space.  It is realloc'd as necessary.
                    717:    Return the number of bytes read and stored at *LINEPTR (not including the
                    718:    NUL terminator), or -1 on error or EOF.  */
1.1.1.2   misho     719: # if @REPLACE_GETLINE@
                    720: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    721: #   undef getline
                    722: #   define getline rpl_getline
                    723: #  endif
                    724: _GL_FUNCDECL_RPL (getline, ssize_t,
                    725:                   (char **lineptr, size_t *linesize, FILE *stream)
                    726:                   _GL_ARG_NONNULL ((1, 2, 3)));
                    727: _GL_CXXALIAS_RPL (getline, ssize_t,
                    728:                   (char **lineptr, size_t *linesize, FILE *stream));
                    729: # else
                    730: #  if !@HAVE_DECL_GETLINE@
                    731: _GL_FUNCDECL_SYS (getline, ssize_t,
                    732:                   (char **lineptr, size_t *linesize, FILE *stream)
                    733:                   _GL_ARG_NONNULL ((1, 2, 3)));
                    734: #  endif
                    735: _GL_CXXALIAS_SYS (getline, ssize_t,
                    736:                   (char **lineptr, size_t *linesize, FILE *stream));
                    737: # endif
                    738: # if @HAVE_DECL_GETLINE@
                    739: _GL_CXXALIASWARN (getline);
1.1       misho     740: # endif
                    741: #elif defined GNULIB_POSIXCHECK
                    742: # undef getline
1.1.1.2   misho     743: # if HAVE_RAW_DECL_GETLINE
                    744: _GL_WARN_ON_USE (getline, "getline is unportable - "
                    745:                  "use gnulib module getline for portability");
                    746: # endif
                    747: #endif
                    748: 
                    749: /* It is very rare that the developer ever has full control of stdin,
1.1.1.3 ! misho     750:    so any use of gets warrants an unconditional warning; besides, C11
        !           751:    removed it.  */
        !           752: #undef gets
        !           753: #if HAVE_RAW_DECL_GETS && !defined __cplusplus
1.1.1.2   misho     754: _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
                    755: #endif
                    756: 
                    757: #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
                    758: struct obstack;
                    759: /* Grow an obstack with formatted output.  Return the number of
                    760:    bytes added to OBS.  No trailing nul byte is added, and the
                    761:    object should be closed with obstack_finish before use.  Upon
                    762:    memory allocation error, call obstack_alloc_failed_handler.  Upon
                    763:    other error, return -1.  */
                    764: # if @REPLACE_OBSTACK_PRINTF@
                    765: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    766: #   define obstack_printf rpl_obstack_printf
                    767: #  endif
                    768: _GL_FUNCDECL_RPL (obstack_printf, int,
                    769:                   (struct obstack *obs, const char *format, ...)
                    770:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                    771:                   _GL_ARG_NONNULL ((1, 2)));
                    772: _GL_CXXALIAS_RPL (obstack_printf, int,
                    773:                   (struct obstack *obs, const char *format, ...));
                    774: # else
                    775: #  if !@HAVE_DECL_OBSTACK_PRINTF@
                    776: _GL_FUNCDECL_SYS (obstack_printf, int,
                    777:                   (struct obstack *obs, const char *format, ...)
                    778:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                    779:                   _GL_ARG_NONNULL ((1, 2)));
                    780: #  endif
                    781: _GL_CXXALIAS_SYS (obstack_printf, int,
                    782:                   (struct obstack *obs, const char *format, ...));
                    783: # endif
                    784: _GL_CXXALIASWARN (obstack_printf);
                    785: # if @REPLACE_OBSTACK_PRINTF@
                    786: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    787: #   define obstack_vprintf rpl_obstack_vprintf
                    788: #  endif
                    789: _GL_FUNCDECL_RPL (obstack_vprintf, int,
                    790:                   (struct obstack *obs, const char *format, va_list args)
                    791:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                    792:                   _GL_ARG_NONNULL ((1, 2)));
                    793: _GL_CXXALIAS_RPL (obstack_vprintf, int,
                    794:                   (struct obstack *obs, const char *format, va_list args));
                    795: # else
                    796: #  if !@HAVE_DECL_OBSTACK_PRINTF@
                    797: _GL_FUNCDECL_SYS (obstack_vprintf, int,
                    798:                   (struct obstack *obs, const char *format, va_list args)
                    799:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                    800:                   _GL_ARG_NONNULL ((1, 2)));
                    801: #  endif
                    802: _GL_CXXALIAS_SYS (obstack_vprintf, int,
                    803:                   (struct obstack *obs, const char *format, va_list args));
                    804: # endif
                    805: _GL_CXXALIASWARN (obstack_vprintf);
1.1       misho     806: #endif
                    807: 
1.1.1.3 ! misho     808: #if @GNULIB_PCLOSE@
        !           809: # if !@HAVE_PCLOSE@
        !           810: _GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
        !           811: # endif
        !           812: _GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
        !           813: _GL_CXXALIASWARN (pclose);
        !           814: #elif defined GNULIB_POSIXCHECK
        !           815: # undef pclose
        !           816: # if HAVE_RAW_DECL_PCLOSE
        !           817: _GL_WARN_ON_USE (pclose, "pclose is unportable - "
        !           818:                  "use gnulib module pclose for more portability");
        !           819: # endif
        !           820: #endif
        !           821: 
1.1       misho     822: #if @GNULIB_PERROR@
                    823: /* Print a message to standard error, describing the value of ERRNO,
                    824:    (if STRING is not NULL and not empty) prefixed with STRING and ": ",
                    825:    and terminated with a newline.  */
1.1.1.2   misho     826: # if @REPLACE_PERROR@
                    827: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    828: #   define perror rpl_perror
                    829: #  endif
                    830: _GL_FUNCDECL_RPL (perror, void, (const char *string));
                    831: _GL_CXXALIAS_RPL (perror, void, (const char *string));
                    832: # else
                    833: _GL_CXXALIAS_SYS (perror, void, (const char *string));
1.1       misho     834: # endif
1.1.1.2   misho     835: _GL_CXXALIASWARN (perror);
1.1       misho     836: #elif defined GNULIB_POSIXCHECK
                    837: # undef perror
1.1.1.2   misho     838: /* Assume perror is always declared.  */
                    839: _GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
                    840:                  "use gnulib module perror for portability");
1.1       misho     841: #endif
                    842: 
1.1.1.2   misho     843: #if @GNULIB_POPEN@
                    844: # if @REPLACE_POPEN@
                    845: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    846: #   undef popen
                    847: #   define popen rpl_popen
                    848: #  endif
                    849: _GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
                    850:                                  _GL_ARG_NONNULL ((1, 2)));
                    851: _GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
                    852: # else
1.1.1.3 ! misho     853: #  if !@HAVE_POPEN@
        !           854: _GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
        !           855:                                  _GL_ARG_NONNULL ((1, 2)));
        !           856: #  endif
1.1.1.2   misho     857: _GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
                    858: # endif
                    859: _GL_CXXALIASWARN (popen);
                    860: #elif defined GNULIB_POSIXCHECK
                    861: # undef popen
                    862: # if HAVE_RAW_DECL_POPEN
                    863: _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
                    864:                  "use gnulib module popen or pipe for more portability");
                    865: # endif
                    866: #endif
                    867: 
                    868: #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
                    869: # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
                    870:      || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
                    871: #  if defined __GNUC__
                    872: #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    873: /* Don't break __attribute__((format(printf,M,N))).  */
                    874: #    define printf __printf__
                    875: #   endif
                    876: #   if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
                    877: _GL_FUNCDECL_RPL_1 (__printf__, int,
                    878:                     (const char *format, ...)
                    879:                     __asm__ (@ASM_SYMBOL_PREFIX@
                    880:                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
                    881:                     _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
                    882:                     _GL_ARG_NONNULL ((1)));
                    883: #   else
                    884: _GL_FUNCDECL_RPL_1 (__printf__, int,
                    885:                     (const char *format, ...)
                    886:                     __asm__ (@ASM_SYMBOL_PREFIX@
                    887:                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
                    888:                     _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
                    889:                     _GL_ARG_NONNULL ((1)));
                    890: #   endif
                    891: _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
                    892: #  else
                    893: #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    894: #    define printf rpl_printf
                    895: #   endif
                    896: _GL_FUNCDECL_RPL (printf, int,
                    897:                   (const char *format, ...)
                    898:                   _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
                    899:                   _GL_ARG_NONNULL ((1)));
                    900: _GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
                    901: #  endif
                    902: #  define GNULIB_overrides_printf 1
                    903: # else
                    904: _GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
                    905: # endif
                    906: _GL_CXXALIASWARN (printf);
                    907: #endif
                    908: #if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
                    909: # if !GNULIB_overrides_printf
                    910: #  undef printf
                    911: # endif
                    912: /* Assume printf is always declared.  */
                    913: _GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
                    914:                  "use gnulib module printf-posix for portable "
                    915:                  "POSIX compliance");
                    916: #endif
                    917: 
                    918: #if @GNULIB_PUTC@
                    919: # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
                    920: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    921: #   undef putc
                    922: #   define putc rpl_fputc
                    923: #  endif
                    924: _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
                    925: _GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
                    926: # else
                    927: _GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
                    928: # endif
                    929: _GL_CXXALIASWARN (putc);
                    930: #endif
                    931: 
                    932: #if @GNULIB_PUTCHAR@
                    933: # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
                    934: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    935: #   undef putchar
                    936: #   define putchar rpl_putchar
                    937: #  endif
                    938: _GL_FUNCDECL_RPL (putchar, int, (int c));
                    939: _GL_CXXALIAS_RPL (putchar, int, (int c));
                    940: # else
                    941: _GL_CXXALIAS_SYS (putchar, int, (int c));
                    942: # endif
                    943: _GL_CXXALIASWARN (putchar);
                    944: #endif
                    945: 
                    946: #if @GNULIB_PUTS@
                    947: # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
                    948: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    949: #   undef puts
                    950: #   define puts rpl_puts
                    951: #  endif
                    952: _GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
                    953: _GL_CXXALIAS_RPL (puts, int, (const char *string));
                    954: # else
                    955: _GL_CXXALIAS_SYS (puts, int, (const char *string));
                    956: # endif
                    957: _GL_CXXALIASWARN (puts);
                    958: #endif
                    959: 
                    960: #if @GNULIB_REMOVE@
                    961: # if @REPLACE_REMOVE@
                    962: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    963: #   undef remove
                    964: #   define remove rpl_remove
                    965: #  endif
                    966: _GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
                    967: _GL_CXXALIAS_RPL (remove, int, (const char *name));
                    968: # else
                    969: _GL_CXXALIAS_SYS (remove, int, (const char *name));
                    970: # endif
                    971: _GL_CXXALIASWARN (remove);
                    972: #elif defined GNULIB_POSIXCHECK
                    973: # undef remove
                    974: /* Assume remove is always declared.  */
                    975: _GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
                    976:                  "use gnulib module remove for more portability");
                    977: #endif
                    978: 
                    979: #if @GNULIB_RENAME@
                    980: # if @REPLACE_RENAME@
                    981: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                    982: #   undef rename
                    983: #   define rename rpl_rename
                    984: #  endif
                    985: _GL_FUNCDECL_RPL (rename, int,
                    986:                   (const char *old_filename, const char *new_filename)
                    987:                   _GL_ARG_NONNULL ((1, 2)));
                    988: _GL_CXXALIAS_RPL (rename, int,
                    989:                   (const char *old_filename, const char *new_filename));
                    990: # else
                    991: _GL_CXXALIAS_SYS (rename, int,
                    992:                   (const char *old_filename, const char *new_filename));
                    993: # endif
                    994: _GL_CXXALIASWARN (rename);
                    995: #elif defined GNULIB_POSIXCHECK
                    996: # undef rename
                    997: /* Assume rename is always declared.  */
                    998: _GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
                    999:                  "use gnulib module rename for more portability");
                   1000: #endif
                   1001: 
                   1002: #if @GNULIB_RENAMEAT@
                   1003: # if @REPLACE_RENAMEAT@
                   1004: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1005: #   undef renameat
                   1006: #   define renameat rpl_renameat
                   1007: #  endif
                   1008: _GL_FUNCDECL_RPL (renameat, int,
                   1009:                   (int fd1, char const *file1, int fd2, char const *file2)
                   1010:                   _GL_ARG_NONNULL ((2, 4)));
                   1011: _GL_CXXALIAS_RPL (renameat, int,
                   1012:                   (int fd1, char const *file1, int fd2, char const *file2));
                   1013: # else
                   1014: #  if !@HAVE_RENAMEAT@
                   1015: _GL_FUNCDECL_SYS (renameat, int,
                   1016:                   (int fd1, char const *file1, int fd2, char const *file2)
                   1017:                   _GL_ARG_NONNULL ((2, 4)));
                   1018: #  endif
                   1019: _GL_CXXALIAS_SYS (renameat, int,
                   1020:                   (int fd1, char const *file1, int fd2, char const *file2));
                   1021: # endif
                   1022: _GL_CXXALIASWARN (renameat);
                   1023: #elif defined GNULIB_POSIXCHECK
                   1024: # undef renameat
                   1025: # if HAVE_RAW_DECL_RENAMEAT
                   1026: _GL_WARN_ON_USE (renameat, "renameat is not portable - "
                   1027:                  "use gnulib module renameat for portability");
                   1028: # endif
                   1029: #endif
                   1030: 
                   1031: #if @GNULIB_SCANF@
                   1032: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                   1033: #  if defined __GNUC__
                   1034: #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1035: #    undef scanf
                   1036: /* Don't break __attribute__((format(scanf,M,N))).  */
                   1037: #    define scanf __scanf__
                   1038: #   endif
                   1039: _GL_FUNCDECL_RPL_1 (__scanf__, int,
                   1040:                     (const char *format, ...)
                   1041:                     __asm__ (@ASM_SYMBOL_PREFIX@
                   1042:                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
                   1043:                     _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
                   1044:                     _GL_ARG_NONNULL ((1)));
                   1045: _GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
                   1046: #  else
                   1047: #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1048: #    undef scanf
                   1049: #    define scanf rpl_scanf
                   1050: #   endif
                   1051: _GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
                   1052:                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
                   1053:                               _GL_ARG_NONNULL ((1)));
                   1054: _GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
                   1055: #  endif
                   1056: # else
                   1057: _GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
                   1058: # endif
                   1059: _GL_CXXALIASWARN (scanf);
                   1060: #endif
                   1061: 
                   1062: #if @GNULIB_SNPRINTF@
                   1063: # if @REPLACE_SNPRINTF@
                   1064: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1065: #   define snprintf rpl_snprintf
                   1066: #  endif
                   1067: _GL_FUNCDECL_RPL (snprintf, int,
                   1068:                   (char *str, size_t size, const char *format, ...)
                   1069:                   _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
                   1070:                   _GL_ARG_NONNULL ((3)));
                   1071: _GL_CXXALIAS_RPL (snprintf, int,
                   1072:                   (char *str, size_t size, const char *format, ...));
                   1073: # else
                   1074: #  if !@HAVE_DECL_SNPRINTF@
                   1075: _GL_FUNCDECL_SYS (snprintf, int,
                   1076:                   (char *str, size_t size, const char *format, ...)
                   1077:                   _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
                   1078:                   _GL_ARG_NONNULL ((3)));
                   1079: #  endif
                   1080: _GL_CXXALIAS_SYS (snprintf, int,
                   1081:                   (char *str, size_t size, const char *format, ...));
                   1082: # endif
                   1083: _GL_CXXALIASWARN (snprintf);
                   1084: #elif defined GNULIB_POSIXCHECK
                   1085: # undef snprintf
                   1086: # if HAVE_RAW_DECL_SNPRINTF
                   1087: _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
                   1088:                  "use gnulib module snprintf for portability");
                   1089: # endif
                   1090: #endif
                   1091: 
1.1.1.3 ! misho    1092: /* Some people would argue that all sprintf uses should be warned about
        !          1093:    (for example, OpenBSD issues a link warning for it),
        !          1094:    since it can cause security holes due to buffer overruns.
1.1.1.2   misho    1095:    However, we believe that sprintf can be used safely, and is more
                   1096:    efficient than snprintf in those safe cases; and as proof of our
                   1097:    belief, we use sprintf in several gnulib modules.  So this header
                   1098:    intentionally avoids adding a warning to sprintf except when
                   1099:    GNULIB_POSIXCHECK is defined.  */
                   1100: 
                   1101: #if @GNULIB_SPRINTF_POSIX@
                   1102: # if @REPLACE_SPRINTF@
                   1103: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1104: #   define sprintf rpl_sprintf
                   1105: #  endif
                   1106: _GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
                   1107:                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                   1108:                                 _GL_ARG_NONNULL ((1, 2)));
                   1109: _GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
                   1110: # else
                   1111: _GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
                   1112: # endif
                   1113: _GL_CXXALIASWARN (sprintf);
                   1114: #elif defined GNULIB_POSIXCHECK
                   1115: # undef sprintf
                   1116: /* Assume sprintf is always declared.  */
                   1117: _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
                   1118:                  "use gnulib module sprintf-posix for portable "
                   1119:                  "POSIX compliance");
                   1120: #endif
                   1121: 
                   1122: #if @GNULIB_TMPFILE@
                   1123: # if @REPLACE_TMPFILE@
                   1124: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1125: #   define tmpfile rpl_tmpfile
                   1126: #  endif
                   1127: _GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
                   1128: _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
                   1129: # else
                   1130: _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
                   1131: # endif
                   1132: _GL_CXXALIASWARN (tmpfile);
                   1133: #elif defined GNULIB_POSIXCHECK
                   1134: # undef tmpfile
                   1135: # if HAVE_RAW_DECL_TMPFILE
                   1136: _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
                   1137:                  "use gnulib module tmpfile for portability");
                   1138: # endif
                   1139: #endif
                   1140: 
                   1141: #if @GNULIB_VASPRINTF@
                   1142: /* Write formatted output to a string dynamically allocated with malloc().
                   1143:    If the memory allocation succeeds, store the address of the string in
                   1144:    *RESULT and return the number of resulting bytes, excluding the trailing
                   1145:    NUL.  Upon memory allocation error, or some other error, return -1.  */
                   1146: # if @REPLACE_VASPRINTF@
                   1147: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1148: #   define asprintf rpl_asprintf
                   1149: #  endif
                   1150: _GL_FUNCDECL_RPL (asprintf, int,
                   1151:                   (char **result, const char *format, ...)
                   1152:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                   1153:                   _GL_ARG_NONNULL ((1, 2)));
                   1154: _GL_CXXALIAS_RPL (asprintf, int,
                   1155:                   (char **result, const char *format, ...));
                   1156: # else
                   1157: #  if !@HAVE_VASPRINTF@
                   1158: _GL_FUNCDECL_SYS (asprintf, int,
                   1159:                   (char **result, const char *format, ...)
                   1160:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                   1161:                   _GL_ARG_NONNULL ((1, 2)));
                   1162: #  endif
                   1163: _GL_CXXALIAS_SYS (asprintf, int,
                   1164:                   (char **result, const char *format, ...));
                   1165: # endif
                   1166: _GL_CXXALIASWARN (asprintf);
                   1167: # if @REPLACE_VASPRINTF@
                   1168: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1169: #   define vasprintf rpl_vasprintf
                   1170: #  endif
                   1171: _GL_FUNCDECL_RPL (vasprintf, int,
                   1172:                   (char **result, const char *format, va_list args)
                   1173:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   1174:                   _GL_ARG_NONNULL ((1, 2)));
                   1175: _GL_CXXALIAS_RPL (vasprintf, int,
                   1176:                   (char **result, const char *format, va_list args));
                   1177: # else
                   1178: #  if !@HAVE_VASPRINTF@
                   1179: _GL_FUNCDECL_SYS (vasprintf, int,
                   1180:                   (char **result, const char *format, va_list args)
                   1181:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   1182:                   _GL_ARG_NONNULL ((1, 2)));
                   1183: #  endif
                   1184: _GL_CXXALIAS_SYS (vasprintf, int,
                   1185:                   (char **result, const char *format, va_list args));
                   1186: # endif
                   1187: _GL_CXXALIASWARN (vasprintf);
                   1188: #endif
                   1189: 
                   1190: #if @GNULIB_VDPRINTF@
                   1191: # if @REPLACE_VDPRINTF@
                   1192: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1193: #   define vdprintf rpl_vdprintf
                   1194: #  endif
                   1195: _GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
                   1196:                                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   1197:                                  _GL_ARG_NONNULL ((2)));
                   1198: _GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
                   1199: # else
                   1200: #  if !@HAVE_VDPRINTF@
                   1201: _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
                   1202:                                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   1203:                                  _GL_ARG_NONNULL ((2)));
                   1204: #  endif
                   1205: /* Need to cast, because on Solaris, the third parameter will likely be
                   1206:                                                     __va_list args.  */
                   1207: _GL_CXXALIAS_SYS_CAST (vdprintf, int,
                   1208:                        (int fd, const char *format, va_list args));
                   1209: # endif
                   1210: _GL_CXXALIASWARN (vdprintf);
                   1211: #elif defined GNULIB_POSIXCHECK
                   1212: # undef vdprintf
                   1213: # if HAVE_RAW_DECL_VDPRINTF
                   1214: _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
                   1215:                  "use gnulib module vdprintf for portability");
                   1216: # endif
1.1       misho    1217: #endif
                   1218: 
1.1.1.2   misho    1219: #if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
                   1220: # if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
                   1221:      || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
                   1222: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1223: #   define vfprintf rpl_vfprintf
                   1224: #  endif
                   1225: #  define GNULIB_overrides_vfprintf 1
                   1226: #  if @GNULIB_VFPRINTF_POSIX@
                   1227: _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
                   1228:                                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   1229:                                  _GL_ARG_NONNULL ((1, 2)));
                   1230: #  else
                   1231: _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
                   1232:                                  _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
                   1233:                                  _GL_ARG_NONNULL ((1, 2)));
                   1234: #  endif
                   1235: _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
                   1236: # else
                   1237: /* Need to cast, because on Solaris, the third parameter is
                   1238:                                                       __va_list args
                   1239:    and GCC's fixincludes did not change this to __gnuc_va_list.  */
                   1240: _GL_CXXALIAS_SYS_CAST (vfprintf, int,
                   1241:                        (FILE *fp, const char *format, va_list args));
                   1242: # endif
                   1243: _GL_CXXALIASWARN (vfprintf);
                   1244: #endif
                   1245: #if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
                   1246: # if !GNULIB_overrides_vfprintf
                   1247: #  undef vfprintf
                   1248: # endif
                   1249: /* Assume vfprintf is always declared.  */
                   1250: _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
                   1251:                  "use gnulib module vfprintf-posix for portable "
                   1252:                       "POSIX compliance");
                   1253: #endif
                   1254: 
                   1255: #if @GNULIB_VFSCANF@
                   1256: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                   1257: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1258: #   undef vfscanf
                   1259: #   define vfscanf rpl_vfscanf
                   1260: #  endif
                   1261: _GL_FUNCDECL_RPL (vfscanf, int,
                   1262:                   (FILE *stream, const char *format, va_list args)
                   1263:                   _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
                   1264:                   _GL_ARG_NONNULL ((1, 2)));
                   1265: _GL_CXXALIAS_RPL (vfscanf, int,
                   1266:                   (FILE *stream, const char *format, va_list args));
                   1267: # else
                   1268: _GL_CXXALIAS_SYS (vfscanf, int,
                   1269:                   (FILE *stream, const char *format, va_list args));
                   1270: # endif
                   1271: _GL_CXXALIASWARN (vfscanf);
                   1272: #endif
                   1273: 
                   1274: #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
                   1275: # if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
                   1276:      || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
                   1277: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1278: #   define vprintf rpl_vprintf
                   1279: #  endif
                   1280: #  define GNULIB_overrides_vprintf 1
                   1281: #  if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
                   1282: _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
                   1283:                                 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
                   1284:                                 _GL_ARG_NONNULL ((1)));
                   1285: #  else
                   1286: _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
                   1287:                                 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
                   1288:                                 _GL_ARG_NONNULL ((1)));
                   1289: #  endif
                   1290: _GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
                   1291: # else
                   1292: /* Need to cast, because on Solaris, the second parameter is
                   1293:                                                           __va_list args
                   1294:    and GCC's fixincludes did not change this to __gnuc_va_list.  */
                   1295: _GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
                   1296: # endif
                   1297: _GL_CXXALIASWARN (vprintf);
                   1298: #endif
                   1299: #if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
                   1300: # if !GNULIB_overrides_vprintf
                   1301: #  undef vprintf
                   1302: # endif
                   1303: /* Assume vprintf is always declared.  */
                   1304: _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
                   1305:                  "use gnulib module vprintf-posix for portable "
                   1306:                  "POSIX compliance");
                   1307: #endif
                   1308: 
                   1309: #if @GNULIB_VSCANF@
                   1310: # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
                   1311: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1312: #   undef vscanf
                   1313: #   define vscanf rpl_vscanf
                   1314: #  endif
                   1315: _GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
                   1316:                                _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
                   1317:                                _GL_ARG_NONNULL ((1)));
                   1318: _GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
                   1319: # else
                   1320: _GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
                   1321: # endif
                   1322: _GL_CXXALIASWARN (vscanf);
                   1323: #endif
                   1324: 
                   1325: #if @GNULIB_VSNPRINTF@
                   1326: # if @REPLACE_VSNPRINTF@
                   1327: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1328: #   define vsnprintf rpl_vsnprintf
                   1329: #  endif
                   1330: _GL_FUNCDECL_RPL (vsnprintf, int,
                   1331:                   (char *str, size_t size, const char *format, va_list args)
                   1332:                   _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
                   1333:                   _GL_ARG_NONNULL ((3)));
                   1334: _GL_CXXALIAS_RPL (vsnprintf, int,
                   1335:                   (char *str, size_t size, const char *format, va_list args));
                   1336: # else
                   1337: #  if !@HAVE_DECL_VSNPRINTF@
                   1338: _GL_FUNCDECL_SYS (vsnprintf, int,
                   1339:                   (char *str, size_t size, const char *format, va_list args)
                   1340:                   _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
                   1341:                   _GL_ARG_NONNULL ((3)));
                   1342: #  endif
                   1343: _GL_CXXALIAS_SYS (vsnprintf, int,
                   1344:                   (char *str, size_t size, const char *format, va_list args));
                   1345: # endif
                   1346: _GL_CXXALIASWARN (vsnprintf);
                   1347: #elif defined GNULIB_POSIXCHECK
                   1348: # undef vsnprintf
                   1349: # if HAVE_RAW_DECL_VSNPRINTF
                   1350: _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
                   1351:                  "use gnulib module vsnprintf for portability");
                   1352: # endif
                   1353: #endif
                   1354: 
                   1355: #if @GNULIB_VSPRINTF_POSIX@
                   1356: # if @REPLACE_VSPRINTF@
                   1357: #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
                   1358: #   define vsprintf rpl_vsprintf
                   1359: #  endif
                   1360: _GL_FUNCDECL_RPL (vsprintf, int,
                   1361:                   (char *str, const char *format, va_list args)
                   1362:                   _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   1363:                   _GL_ARG_NONNULL ((1, 2)));
                   1364: _GL_CXXALIAS_RPL (vsprintf, int,
                   1365:                   (char *str, const char *format, va_list args));
                   1366: # else
                   1367: /* Need to cast, because on Solaris, the third parameter is
                   1368:                                                        __va_list args
                   1369:    and GCC's fixincludes did not change this to __gnuc_va_list.  */
                   1370: _GL_CXXALIAS_SYS_CAST (vsprintf, int,
                   1371:                        (char *str, const char *format, va_list args));
                   1372: # endif
                   1373: _GL_CXXALIASWARN (vsprintf);
                   1374: #elif defined GNULIB_POSIXCHECK
                   1375: # undef vsprintf
                   1376: /* Assume vsprintf is always declared.  */
                   1377: _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
                   1378:                  "use gnulib module vsprintf-posix for portable "
                   1379:                       "POSIX compliance");
                   1380: #endif
                   1381: 
                   1382: #endif /* _@GUARD_PREFIX@_STDIO_H */
                   1383: #endif /* _@GUARD_PREFIX@_STDIO_H */
1.1       misho    1384: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>