Blame gl/stdio.in.h

Packit 549fdc
/* A GNU-like <stdio.h>.
Packit 549fdc
Packit 549fdc
   Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
Packit 549fdc
Packit 549fdc
   This program is free software; you can redistribute it and/or modify
Packit 549fdc
   it under the terms of the GNU Lesser General Public License as published by
Packit 549fdc
   the Free Software Foundation; either version 2.1, or (at your option)
Packit 549fdc
   any later version.
Packit 549fdc
Packit 549fdc
   This program is distributed in the hope that it will be useful,
Packit 549fdc
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 549fdc
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 549fdc
   GNU Lesser General Public License for more details.
Packit 549fdc
Packit 549fdc
   You should have received a copy of the GNU Lesser General Public License
Packit 549fdc
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
Packit 549fdc
Packit 549fdc
#if __GNUC__ >= 3
Packit 549fdc
@PRAGMA_SYSTEM_HEADER@
Packit 549fdc
#endif
Packit 549fdc
@PRAGMA_COLUMNS@
Packit 549fdc
Packit 549fdc
#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
Packit 549fdc
/* Special invocation convention:
Packit 549fdc
   - Inside glibc header files.
Packit 549fdc
   - On OSF/1 5.1 we have a sequence of nested includes
Packit 549fdc
     <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
Packit 549fdc
     <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
Packit 549fdc
     In this situation, the functions are not yet declared, therefore we cannot
Packit 549fdc
     provide the C++ aliases.  */
Packit 549fdc
Packit 549fdc
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
Packit 549fdc
Packit 549fdc
#else
Packit 549fdc
/* Normal invocation convention.  */
Packit 549fdc
Packit 549fdc
#ifndef _@GUARD_PREFIX@_STDIO_H
Packit 549fdc
Packit 549fdc
#define _GL_ALREADY_INCLUDING_STDIO_H
Packit 549fdc
Packit 549fdc
/* The include_next requires a split double-inclusion guard.  */
Packit 549fdc
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
Packit 549fdc
Packit 549fdc
#undef _GL_ALREADY_INCLUDING_STDIO_H
Packit 549fdc
Packit 549fdc
#ifndef _@GUARD_PREFIX@_STDIO_H
Packit 549fdc
#define _@GUARD_PREFIX@_STDIO_H
Packit 549fdc
Packit 549fdc
/* Get va_list.  Needed on many systems, including glibc 2.8.  */
Packit 549fdc
#include <stdarg.h>
Packit 549fdc
Packit 549fdc
#include <stddef.h>
Packit 549fdc
Packit 549fdc
/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8
Packit 549fdc
   and eglibc 2.11.2.
Packit 549fdc
   May also define off_t to a 64-bit type on native Windows.  */
Packit 549fdc
#include <sys/types.h>
Packit 549fdc
Packit 549fdc
/* The __attribute__ feature is available in gcc versions 2.5 and later.
Packit 549fdc
   The __-protected variants of the attributes 'format' and 'printf' are
Packit 549fdc
   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
Packit 549fdc
   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
Packit 549fdc
   gnulib and libintl do '#define printf __printf__' when they override
Packit 549fdc
   the 'printf' function.  */
Packit 549fdc
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
Packit 549fdc
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
Packit 549fdc
#else
Packit 549fdc
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* _GL_ATTRIBUTE_FORMAT_PRINTF
Packit 549fdc
   indicates to GCC that the function takes a format string and arguments,
Packit 549fdc
   where the format string directives are the ones standardized by ISO C99
Packit 549fdc
   and POSIX.  */
Packit 549fdc
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
Packit 549fdc
# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
Packit 549fdc
   _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
Packit 549fdc
#else
Packit 549fdc
# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
Packit 549fdc
   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
Packit 549fdc
   except that it indicates to GCC that the supported format string directives
Packit 549fdc
   are the ones of the system printf(), rather than the ones standardized by
Packit 549fdc
   ISO C99 and POSIX.  */
Packit 549fdc
#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
Packit 549fdc
# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
Packit 549fdc
  _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument)
Packit 549fdc
#else
Packit 549fdc
# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
Packit 549fdc
  _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* _GL_ATTRIBUTE_FORMAT_SCANF
Packit 549fdc
   indicates to GCC that the function takes a format string and arguments,
Packit 549fdc
   where the format string directives are the ones standardized by ISO C99
Packit 549fdc
   and POSIX.  */
Packit 549fdc
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
Packit 549fdc
# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
Packit 549fdc
   _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
Packit 549fdc
#else
Packit 549fdc
# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
Packit 549fdc
   _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
Packit 549fdc
   except that it indicates to GCC that the supported format string directives
Packit 549fdc
   are the ones of the system scanf(), rather than the ones standardized by
Packit 549fdc
   ISO C99 and POSIX.  */
Packit 549fdc
#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
Packit 549fdc
  _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
Packit 549fdc
Packit 549fdc
/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
Packit 549fdc
/* But in any case avoid namespace pollution on glibc systems.  */
Packit 549fdc
#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
Packit 549fdc
    && ! defined __GLIBC__
Packit 549fdc
# include <unistd.h>
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit 549fdc
Packit 549fdc
/* The definition of _GL_ARG_NONNULL is copied here.  */
Packit 549fdc
Packit 549fdc
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit 549fdc
Packit 549fdc
/* Macros for stringification.  */
Packit 549fdc
#define _GL_STDIO_STRINGIZE(token) #token
Packit 549fdc
#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
Packit 549fdc
Packit 549fdc
/* When also using extern inline, suppress the use of static inline in
Packit 549fdc
   standard headers of problematic Apple configurations, as Libc at
Packit 549fdc
   least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
Packit 549fdc
   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Packit 549fdc
   Perhaps Apple will fix this some day.  */
Packit 549fdc
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
Packit 549fdc
     && defined __GNUC__ && defined __STDC__)
Packit 549fdc
# undef putc_unlocked
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_DPRINTF@
Packit 549fdc
# if @REPLACE_DPRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define dprintf rpl_dprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
Packit 549fdc
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
Packit 549fdc
                                _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DPRINTF@
Packit 549fdc
_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
Packit 549fdc
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
Packit 549fdc
                                _GL_ARG_NONNULL ((2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (dprintf);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef dprintf
Packit 549fdc
# if HAVE_RAW_DECL_DPRINTF
Packit 549fdc
_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
Packit 549fdc
                 "use gnulib module dprintf for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FCLOSE@
Packit 549fdc
/* Close STREAM and its underlying file descriptor.  */
Packit 549fdc
# if @REPLACE_FCLOSE@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define fclose rpl_fclose
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fclose);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef fclose
Packit 549fdc
/* Assume fclose is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module fclose for portable POSIX compliance");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FDOPEN@
Packit 549fdc
# if @REPLACE_FDOPEN@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fdopen
Packit 549fdc
#   define fdopen rpl_fdopen
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
Packit 549fdc
                                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fdopen);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef fdopen
Packit 549fdc
/* Assume fdopen is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
Packit 549fdc
                 "use gnulib module fdopen for portability");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FFLUSH@
Packit 549fdc
/* Flush all pending data on STREAM according to POSIX rules.  Both
Packit 549fdc
   output and seekable input streams are supported.
Packit 549fdc
   Note! LOSS OF DATA can occur if fflush is applied on an input stream
Packit 549fdc
   that is _not_seekable_ or on an update stream that is _not_seekable_
Packit 549fdc
   and in which the most recent operation was input.  Seekability can
Packit 549fdc
   be tested with lseek(fileno(fp),0,SEEK_CUR).  */
Packit 549fdc
# if @REPLACE_FFLUSH@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define fflush rpl_fflush
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
Packit 549fdc
_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fflush);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef fflush
Packit 549fdc
/* Assume fflush is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module fflush for portable POSIX compliance");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FGETC@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fgetc
Packit 549fdc
#   define fgetc rpl_fgetc
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fgetc);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FGETS@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fgets
Packit 549fdc
#   define fgets rpl_fgets
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
Packit 549fdc
                                 _GL_ARG_NONNULL ((1, 3)));
Packit 549fdc
_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fgets);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FOPEN@
Packit 549fdc
# if @REPLACE_FOPEN@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fopen
Packit 549fdc
#   define fopen rpl_fopen
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
Packit 549fdc
                                 _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fopen);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef fopen
Packit 549fdc
/* Assume fopen is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
Packit 549fdc
                 "use gnulib module fopen for portability");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
Packit 549fdc
# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
Packit 549fdc
     || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define fprintf rpl_fprintf
Packit 549fdc
#  endif
Packit 549fdc
#  define GNULIB_overrides_fprintf 1
Packit 549fdc
#  if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
Packit 549fdc
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
Packit 549fdc
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
Packit 549fdc
                                _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  else
Packit 549fdc
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
Packit 549fdc
                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
Packit 549fdc
                                _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fprintf);
Packit 549fdc
#endif
Packit 549fdc
#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
Packit 549fdc
# if !GNULIB_overrides_fprintf
Packit 549fdc
#  undef fprintf
Packit 549fdc
# endif
Packit 549fdc
/* Assume fprintf is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module fprintf-posix for portable "
Packit 549fdc
                 "POSIX compliance");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FPURGE@
Packit 549fdc
/* Discard all pending buffered I/O data on STREAM.
Packit 549fdc
   STREAM must not be wide-character oriented.
Packit 549fdc
   When discarding pending output, the file position is set back to where it
Packit 549fdc
   was before the write calls.  When discarding pending input, the file
Packit 549fdc
   position is advanced to match the end of the previously read input.
Packit 549fdc
   Return 0 if successful.  Upon error, return -1 and set errno.  */
Packit 549fdc
# if @REPLACE_FPURGE@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define fpurge rpl_fpurge
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DECL_FPURGE@
Packit 549fdc
_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fpurge);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef fpurge
Packit 549fdc
# if HAVE_RAW_DECL_FPURGE
Packit 549fdc
_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
Packit 549fdc
                 "use gnulib module fpurge for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FPUTC@
Packit 549fdc
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fputc
Packit 549fdc
#   define fputc rpl_fputc
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fputc);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FPUTS@
Packit 549fdc
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fputs
Packit 549fdc
#   define fputs rpl_fputs
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
Packit 549fdc
                              _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fputs);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FREAD@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fread
Packit 549fdc
#   define fread rpl_fread
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
Packit 549fdc
                                 _GL_ARG_NONNULL ((4)));
Packit 549fdc
_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fread);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FREOPEN@
Packit 549fdc
# if @REPLACE_FREOPEN@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef freopen
Packit 549fdc
#   define freopen rpl_freopen
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (freopen, FILE *,
Packit 549fdc
                  (const char *filename, const char *mode, FILE *stream)
Packit 549fdc
                  _GL_ARG_NONNULL ((2, 3)));
Packit 549fdc
_GL_CXXALIAS_RPL (freopen, FILE *,
Packit 549fdc
                  (const char *filename, const char *mode, FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (freopen, FILE *,
Packit 549fdc
                  (const char *filename, const char *mode, FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (freopen);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef freopen
Packit 549fdc
/* Assume freopen is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (freopen,
Packit 549fdc
                 "freopen on native Windows platforms is not POSIX compliant - "
Packit 549fdc
                 "use gnulib module freopen for portability");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FSCANF@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fscanf
Packit 549fdc
#   define fscanf rpl_fscanf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
Packit 549fdc
                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
Packit 549fdc
                               _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fscanf);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Set up the following warnings, based on which modules are in use.
Packit 549fdc
   GNU Coding Standards discourage the use of fseek, since it imposes
Packit 549fdc
   an arbitrary limitation on some 32-bit hosts.  Remember that the
Packit 549fdc
   fseek module depends on the fseeko module, so we only have three
Packit 549fdc
   cases to consider:
Packit 549fdc
Packit 549fdc
   1. The developer is not using either module.  Issue a warning under
Packit 549fdc
   GNULIB_POSIXCHECK for both functions, to remind them that both
Packit 549fdc
   functions have bugs on some systems.  _GL_NO_LARGE_FILES has no
Packit 549fdc
   impact on this warning.
Packit 549fdc
Packit 549fdc
   2. The developer is using both modules.  They may be unaware of the
Packit 549fdc
   arbitrary limitations of fseek, so issue a warning under
Packit 549fdc
   GNULIB_POSIXCHECK.  On the other hand, they may be using both
Packit 549fdc
   modules intentionally, so the developer can define
Packit 549fdc
   _GL_NO_LARGE_FILES in the compilation units where the use of fseek
Packit 549fdc
   is safe, to silence the warning.
Packit 549fdc
Packit 549fdc
   3. The developer is using the fseeko module, but not fseek.  Gnulib
Packit 549fdc
   guarantees that fseek will still work around platform bugs in that
Packit 549fdc
   case, but we presume that the developer is aware of the pitfalls of
Packit 549fdc
   fseek and was trying to avoid it, so issue a warning even when
Packit 549fdc
   GNULIB_POSIXCHECK is undefined.  Again, _GL_NO_LARGE_FILES can be
Packit 549fdc
   defined to silence the warning in particular compilation units.
Packit 549fdc
   In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
Packit 549fdc
   fseek gets defined as a macro, it is recommended that the developer
Packit 549fdc
   uses the fseek module, even if he is not calling the fseek function.
Packit 549fdc
Packit 549fdc
   Most gnulib clients that perform stream operations should fall into
Packit 549fdc
   category 3.  */
Packit 549fdc
Packit 549fdc
#if @GNULIB_FSEEK@
Packit 549fdc
# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
Packit 549fdc
#  define _GL_FSEEK_WARN /* Category 2, above.  */
Packit 549fdc
#  undef fseek
Packit 549fdc
# endif
Packit 549fdc
# if @REPLACE_FSEEK@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fseek
Packit 549fdc
#   define fseek rpl_fseek
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
Packit 549fdc
                              _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fseek);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FSEEKO@
Packit 549fdc
# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
Packit 549fdc
#  define _GL_FSEEK_WARN /* Category 3, above.  */
Packit 549fdc
#  undef fseek
Packit 549fdc
# endif
Packit 549fdc
# if @REPLACE_FSEEKO@
Packit 549fdc
/* Provide an fseeko function that is aware of a preceding fflush(), and which
Packit 549fdc
   detects pipes.  */
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fseeko
Packit 549fdc
#   define fseeko rpl_fseeko
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
Packit 549fdc
                               _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
Packit 549fdc
# else
Packit 549fdc
#  if ! @HAVE_DECL_FSEEKO@
Packit 549fdc
_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
Packit 549fdc
                               _GL_ARG_NONNULL ((1)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fseeko);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# define _GL_FSEEK_WARN /* Category 1, above.  */
Packit 549fdc
# undef fseek
Packit 549fdc
# undef fseeko
Packit 549fdc
# if HAVE_RAW_DECL_FSEEKO
Packit 549fdc
_GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
Packit 549fdc
                 "use gnulib module fseeko for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#ifdef _GL_FSEEK_WARN
Packit 549fdc
# undef _GL_FSEEK_WARN
Packit 549fdc
/* Here, either fseek is undefined (but C89 guarantees that it is
Packit 549fdc
   declared), or it is defined as rpl_fseek (declared above).  */
Packit 549fdc
_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
Packit 549fdc
                 "on 32-bit platforms - "
Packit 549fdc
                 "use fseeko function for handling of large files");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* ftell, ftello.  See the comments on fseek/fseeko.  */
Packit 549fdc
Packit 549fdc
#if @GNULIB_FTELL@
Packit 549fdc
# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
Packit 549fdc
#  define _GL_FTELL_WARN /* Category 2, above.  */
Packit 549fdc
#  undef ftell
Packit 549fdc
# endif
Packit 549fdc
# if @REPLACE_FTELL@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef ftell
Packit 549fdc
#   define ftell rpl_ftell
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (ftell);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_FTELLO@
Packit 549fdc
# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
Packit 549fdc
#  define _GL_FTELL_WARN /* Category 3, above.  */
Packit 549fdc
#  undef ftell
Packit 549fdc
# endif
Packit 549fdc
# if @REPLACE_FTELLO@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef ftello
Packit 549fdc
#   define ftello rpl_ftello
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
Packit 549fdc
# else
Packit 549fdc
#  if ! @HAVE_DECL_FTELLO@
Packit 549fdc
_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (ftello);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# define _GL_FTELL_WARN /* Category 1, above.  */
Packit 549fdc
# undef ftell
Packit 549fdc
# undef ftello
Packit 549fdc
# if HAVE_RAW_DECL_FTELLO
Packit 549fdc
_GL_WARN_ON_USE (ftello, "ftello is unportable - "
Packit 549fdc
                 "use gnulib module ftello for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#ifdef _GL_FTELL_WARN
Packit 549fdc
# undef _GL_FTELL_WARN
Packit 549fdc
/* Here, either ftell is undefined (but C89 guarantees that it is
Packit 549fdc
   declared), or it is defined as rpl_ftell (declared above).  */
Packit 549fdc
_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
Packit 549fdc
                 "on 32-bit platforms - "
Packit 549fdc
                 "use ftello function for handling of large files");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
#if @GNULIB_FWRITE@
Packit 549fdc
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef fwrite
Packit 549fdc
#   define fwrite rpl_fwrite
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fwrite, size_t,
Packit 549fdc
                  (const void *ptr, size_t s, size_t n, FILE *stream)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 4)));
Packit 549fdc
_GL_CXXALIAS_RPL (fwrite, size_t,
Packit 549fdc
                  (const void *ptr, size_t s, size_t n, FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (fwrite, size_t,
Packit 549fdc
                  (const void *ptr, size_t s, size_t n, FILE *stream));
Packit 549fdc
Packit 549fdc
/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
Packit 549fdc
   <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
Packit 549fdc
   which sometimes causes an unwanted diagnostic for fwrite calls.
Packit 549fdc
   This affects only function declaration attributes under certain
Packit 549fdc
   versions of gcc and clang, and is not needed for C++.  */
Packit 549fdc
#  if (0 < __USE_FORTIFY_LEVEL                                          \
Packit 549fdc
       && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
Packit 549fdc
       && 3 < __GNUC__ + (4 <= __GNUC_MINOR__)                          \
Packit 549fdc
       && !defined __cplusplus)
Packit 549fdc
#   undef fwrite
Packit 549fdc
#   undef fwrite_unlocked
Packit 549fdc
extern size_t __REDIRECT (rpl_fwrite,
Packit 549fdc
                          (const void *__restrict, size_t, size_t,
Packit 549fdc
                           FILE *__restrict),
Packit 549fdc
                          fwrite);
Packit 549fdc
extern size_t __REDIRECT (rpl_fwrite_unlocked,
Packit 549fdc
                          (const void *__restrict, size_t, size_t,
Packit 549fdc
                           FILE *__restrict),
Packit 549fdc
                          fwrite_unlocked);
Packit 549fdc
#   define fwrite rpl_fwrite
Packit 549fdc
#   define fwrite_unlocked rpl_fwrite_unlocked
Packit 549fdc
#  endif
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (fwrite);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_GETC@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef getc
Packit 549fdc
#   define getc rpl_fgetc
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (getc);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_GETCHAR@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef getchar
Packit 549fdc
#   define getchar rpl_getchar
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (getchar, int, (void));
Packit 549fdc
_GL_CXXALIAS_RPL (getchar, int, (void));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (getchar, int, (void));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (getchar);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_GETDELIM@
Packit 549fdc
/* Read input, up to (and including) the next occurrence of DELIMITER, from
Packit 549fdc
   STREAM, store it in *LINEPTR (and NUL-terminate it).
Packit 549fdc
   *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
Packit 549fdc
   bytes of space.  It is realloc'd as necessary.
Packit 549fdc
   Return the number of bytes read and stored at *LINEPTR (not including the
Packit 549fdc
   NUL terminator), or -1 on error or EOF.  */
Packit 549fdc
# if @REPLACE_GETDELIM@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef getdelim
Packit 549fdc
#   define getdelim rpl_getdelim
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (getdelim, ssize_t,
Packit 549fdc
                  (char **lineptr, size_t *linesize, int delimiter,
Packit 549fdc
                   FILE *stream)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2, 4)));
Packit 549fdc
_GL_CXXALIAS_RPL (getdelim, ssize_t,
Packit 549fdc
                  (char **lineptr, size_t *linesize, int delimiter,
Packit 549fdc
                   FILE *stream));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DECL_GETDELIM@
Packit 549fdc
_GL_FUNCDECL_SYS (getdelim, ssize_t,
Packit 549fdc
                  (char **lineptr, size_t *linesize, int delimiter,
Packit 549fdc
                   FILE *stream)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2, 4)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (getdelim, ssize_t,
Packit 549fdc
                  (char **lineptr, size_t *linesize, int delimiter,
Packit 549fdc
                   FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (getdelim);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef getdelim
Packit 549fdc
# if HAVE_RAW_DECL_GETDELIM
Packit 549fdc
_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
Packit 549fdc
                 "use gnulib module getdelim for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_GETLINE@
Packit 549fdc
/* Read a line, up to (and including) the next newline, from STREAM, store it
Packit 549fdc
   in *LINEPTR (and NUL-terminate it).
Packit 549fdc
   *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
Packit 549fdc
   bytes of space.  It is realloc'd as necessary.
Packit 549fdc
   Return the number of bytes read and stored at *LINEPTR (not including the
Packit 549fdc
   NUL terminator), or -1 on error or EOF.  */
Packit 549fdc
# if @REPLACE_GETLINE@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef getline
Packit 549fdc
#   define getline rpl_getline
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (getline, ssize_t,
Packit 549fdc
                  (char **lineptr, size_t *linesize, FILE *stream)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2, 3)));
Packit 549fdc
_GL_CXXALIAS_RPL (getline, ssize_t,
Packit 549fdc
                  (char **lineptr, size_t *linesize, FILE *stream));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DECL_GETLINE@
Packit 549fdc
_GL_FUNCDECL_SYS (getline, ssize_t,
Packit 549fdc
                  (char **lineptr, size_t *linesize, FILE *stream)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2, 3)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (getline, ssize_t,
Packit 549fdc
                  (char **lineptr, size_t *linesize, FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
# if @HAVE_DECL_GETLINE@
Packit 549fdc
_GL_CXXALIASWARN (getline);
Packit 549fdc
# endif
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef getline
Packit 549fdc
# if HAVE_RAW_DECL_GETLINE
Packit 549fdc
_GL_WARN_ON_USE (getline, "getline is unportable - "
Packit 549fdc
                 "use gnulib module getline for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* It is very rare that the developer ever has full control of stdin,
Packit 549fdc
   so any use of gets warrants an unconditional warning; besides, C11
Packit 549fdc
   removed it.  */
Packit 549fdc
#undef gets
Packit 549fdc
#if HAVE_RAW_DECL_GETS && !defined __cplusplus
Packit 549fdc
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
Packit 549fdc
struct obstack;
Packit 549fdc
/* Grow an obstack with formatted output.  Return the number of
Packit 549fdc
   bytes added to OBS.  No trailing nul byte is added, and the
Packit 549fdc
   object should be closed with obstack_finish before use.  Upon
Packit 549fdc
   memory allocation error, call obstack_alloc_failed_handler.  Upon
Packit 549fdc
   other error, return -1.  */
Packit 549fdc
# if @REPLACE_OBSTACK_PRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define obstack_printf rpl_obstack_printf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (obstack_printf, int,
Packit 549fdc
                  (struct obstack *obs, const char *format, ...)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (obstack_printf, int,
Packit 549fdc
                  (struct obstack *obs, const char *format, ...));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DECL_OBSTACK_PRINTF@
Packit 549fdc
_GL_FUNCDECL_SYS (obstack_printf, int,
Packit 549fdc
                  (struct obstack *obs, const char *format, ...)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (obstack_printf, int,
Packit 549fdc
                  (struct obstack *obs, const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (obstack_printf);
Packit 549fdc
# if @REPLACE_OBSTACK_PRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define obstack_vprintf rpl_obstack_vprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (obstack_vprintf, int,
Packit 549fdc
                  (struct obstack *obs, const char *format, va_list args)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (obstack_vprintf, int,
Packit 549fdc
                  (struct obstack *obs, const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DECL_OBSTACK_PRINTF@
Packit 549fdc
_GL_FUNCDECL_SYS (obstack_vprintf, int,
Packit 549fdc
                  (struct obstack *obs, const char *format, va_list args)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (obstack_vprintf, int,
Packit 549fdc
                  (struct obstack *obs, const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (obstack_vprintf);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_PCLOSE@
Packit 549fdc
# if !@HAVE_PCLOSE@
Packit 549fdc
_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
Packit 549fdc
_GL_CXXALIASWARN (pclose);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef pclose
Packit 549fdc
# if HAVE_RAW_DECL_PCLOSE
Packit 549fdc
_GL_WARN_ON_USE (pclose, "pclose is unportable - "
Packit 549fdc
                 "use gnulib module pclose for more portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_PERROR@
Packit 549fdc
/* Print a message to standard error, describing the value of ERRNO,
Packit 549fdc
   (if STRING is not NULL and not empty) prefixed with STRING and ": ",
Packit 549fdc
   and terminated with a newline.  */
Packit 549fdc
# if @REPLACE_PERROR@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define perror rpl_perror
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (perror, void, (const char *string));
Packit 549fdc
_GL_CXXALIAS_RPL (perror, void, (const char *string));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (perror, void, (const char *string));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (perror);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef perror
Packit 549fdc
/* Assume perror is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module perror for portability");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_POPEN@
Packit 549fdc
# if @REPLACE_POPEN@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef popen
Packit 549fdc
#   define popen rpl_popen
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
Packit 549fdc
                                 _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_POPEN@
Packit 549fdc
_GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
Packit 549fdc
                                 _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (popen);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef popen
Packit 549fdc
# if HAVE_RAW_DECL_POPEN
Packit 549fdc
_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
Packit 549fdc
                 "use gnulib module popen or pipe for more portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
Packit 549fdc
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
Packit 549fdc
     || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
Packit 549fdc
#  if defined __GNUC__
Packit 549fdc
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
/* Don't break __attribute__((format(printf,M,N))).  */
Packit 549fdc
#    define printf __printf__
Packit 549fdc
#   endif
Packit 549fdc
#   if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
Packit 549fdc
_GL_FUNCDECL_RPL_1 (__printf__, int,
Packit 549fdc
                    (const char *format, ...)
Packit 549fdc
                    __asm__ (@ASM_SYMBOL_PREFIX@
Packit 549fdc
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
Packit 549fdc
                    _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
Packit 549fdc
                    _GL_ARG_NONNULL ((1)));
Packit 549fdc
#   else
Packit 549fdc
_GL_FUNCDECL_RPL_1 (__printf__, int,
Packit 549fdc
                    (const char *format, ...)
Packit 549fdc
                    __asm__ (@ASM_SYMBOL_PREFIX@
Packit 549fdc
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
Packit 549fdc
                    _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
Packit 549fdc
                    _GL_ARG_NONNULL ((1)));
Packit 549fdc
#   endif
Packit 549fdc
_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
Packit 549fdc
#  else
Packit 549fdc
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#    define printf rpl_printf
Packit 549fdc
#   endif
Packit 549fdc
_GL_FUNCDECL_RPL (printf, int,
Packit 549fdc
                  (const char *format, ...)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
Packit 549fdc
                  _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
Packit 549fdc
#  endif
Packit 549fdc
#  define GNULIB_overrides_printf 1
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (printf);
Packit 549fdc
#endif
Packit 549fdc
#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
Packit 549fdc
# if !GNULIB_overrides_printf
Packit 549fdc
#  undef printf
Packit 549fdc
# endif
Packit 549fdc
/* Assume printf is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module printf-posix for portable "
Packit 549fdc
                 "POSIX compliance");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_PUTC@
Packit 549fdc
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef putc
Packit 549fdc
#   define putc rpl_fputc
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (putc);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_PUTCHAR@
Packit 549fdc
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef putchar
Packit 549fdc
#   define putchar rpl_putchar
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (putchar, int, (int c));
Packit 549fdc
_GL_CXXALIAS_RPL (putchar, int, (int c));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (putchar, int, (int c));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (putchar);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_PUTS@
Packit 549fdc
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef puts
Packit 549fdc
#   define puts rpl_puts
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (puts, int, (const char *string));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (puts, int, (const char *string));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (puts);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_REMOVE@
Packit 549fdc
# if @REPLACE_REMOVE@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef remove
Packit 549fdc
#   define remove rpl_remove
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (remove, int, (const char *name));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (remove, int, (const char *name));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (remove);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef remove
Packit 549fdc
/* Assume remove is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
Packit 549fdc
                 "use gnulib module remove for more portability");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_RENAME@
Packit 549fdc
# if @REPLACE_RENAME@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef rename
Packit 549fdc
#   define rename rpl_rename
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (rename, int,
Packit 549fdc
                  (const char *old_filename, const char *new_filename)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (rename, int,
Packit 549fdc
                  (const char *old_filename, const char *new_filename));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (rename, int,
Packit 549fdc
                  (const char *old_filename, const char *new_filename));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (rename);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef rename
Packit 549fdc
/* Assume rename is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
Packit 549fdc
                 "use gnulib module rename for more portability");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_RENAMEAT@
Packit 549fdc
# if @REPLACE_RENAMEAT@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef renameat
Packit 549fdc
#   define renameat rpl_renameat
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (renameat, int,
Packit 549fdc
                  (int fd1, char const *file1, int fd2, char const *file2)
Packit 549fdc
                  _GL_ARG_NONNULL ((2, 4)));
Packit 549fdc
_GL_CXXALIAS_RPL (renameat, int,
Packit 549fdc
                  (int fd1, char const *file1, int fd2, char const *file2));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_RENAMEAT@
Packit 549fdc
_GL_FUNCDECL_SYS (renameat, int,
Packit 549fdc
                  (int fd1, char const *file1, int fd2, char const *file2)
Packit 549fdc
                  _GL_ARG_NONNULL ((2, 4)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (renameat, int,
Packit 549fdc
                  (int fd1, char const *file1, int fd2, char const *file2));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (renameat);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef renameat
Packit 549fdc
# if HAVE_RAW_DECL_RENAMEAT
Packit 549fdc
_GL_WARN_ON_USE (renameat, "renameat is not portable - "
Packit 549fdc
                 "use gnulib module renameat for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_SCANF@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if defined __GNUC__
Packit 549fdc
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#    undef scanf
Packit 549fdc
/* Don't break __attribute__((format(scanf,M,N))).  */
Packit 549fdc
#    define scanf __scanf__
Packit 549fdc
#   endif
Packit 549fdc
_GL_FUNCDECL_RPL_1 (__scanf__, int,
Packit 549fdc
                    (const char *format, ...)
Packit 549fdc
                    __asm__ (@ASM_SYMBOL_PREFIX@
Packit 549fdc
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
Packit 549fdc
                    _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
Packit 549fdc
                    _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
Packit 549fdc
#  else
Packit 549fdc
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#    undef scanf
Packit 549fdc
#    define scanf rpl_scanf
Packit 549fdc
#   endif
Packit 549fdc
_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
Packit 549fdc
                              _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
Packit 549fdc
                              _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
Packit 549fdc
#  endif
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (scanf);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_SNPRINTF@
Packit 549fdc
# if @REPLACE_SNPRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define snprintf rpl_snprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (snprintf, int,
Packit 549fdc
                  (char *str, size_t size, const char *format, ...)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
Packit 549fdc
                  _GL_ARG_NONNULL ((3)));
Packit 549fdc
_GL_CXXALIAS_RPL (snprintf, int,
Packit 549fdc
                  (char *str, size_t size, const char *format, ...));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DECL_SNPRINTF@
Packit 549fdc
_GL_FUNCDECL_SYS (snprintf, int,
Packit 549fdc
                  (char *str, size_t size, const char *format, ...)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
Packit 549fdc
                  _GL_ARG_NONNULL ((3)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (snprintf, int,
Packit 549fdc
                  (char *str, size_t size, const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (snprintf);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef snprintf
Packit 549fdc
# if HAVE_RAW_DECL_SNPRINTF
Packit 549fdc
_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
Packit 549fdc
                 "use gnulib module snprintf for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* Some people would argue that all sprintf uses should be warned about
Packit 549fdc
   (for example, OpenBSD issues a link warning for it),
Packit 549fdc
   since it can cause security holes due to buffer overruns.
Packit 549fdc
   However, we believe that sprintf can be used safely, and is more
Packit 549fdc
   efficient than snprintf in those safe cases; and as proof of our
Packit 549fdc
   belief, we use sprintf in several gnulib modules.  So this header
Packit 549fdc
   intentionally avoids adding a warning to sprintf except when
Packit 549fdc
   GNULIB_POSIXCHECK is defined.  */
Packit 549fdc
Packit 549fdc
#if @GNULIB_SPRINTF_POSIX@
Packit 549fdc
# if @REPLACE_SPRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define sprintf rpl_sprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
Packit 549fdc
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
Packit 549fdc
                                _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (sprintf);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef sprintf
Packit 549fdc
/* Assume sprintf is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module sprintf-posix for portable "
Packit 549fdc
                 "POSIX compliance");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_TMPFILE@
Packit 549fdc
# if @REPLACE_TMPFILE@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define tmpfile rpl_tmpfile
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
Packit 549fdc
_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (tmpfile);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef tmpfile
Packit 549fdc
# if HAVE_RAW_DECL_TMPFILE
Packit 549fdc
_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
Packit 549fdc
                 "use gnulib module tmpfile for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_VASPRINTF@
Packit 549fdc
/* Write formatted output to a string dynamically allocated with malloc().
Packit 549fdc
   If the memory allocation succeeds, store the address of the string in
Packit 549fdc
   *RESULT and return the number of resulting bytes, excluding the trailing
Packit 549fdc
   NUL.  Upon memory allocation error, or some other error, return -1.  */
Packit 549fdc
# if @REPLACE_VASPRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define asprintf rpl_asprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (asprintf, int,
Packit 549fdc
                  (char **result, const char *format, ...)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (asprintf, int,
Packit 549fdc
                  (char **result, const char *format, ...));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_VASPRINTF@
Packit 549fdc
_GL_FUNCDECL_SYS (asprintf, int,
Packit 549fdc
                  (char **result, const char *format, ...)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (asprintf, int,
Packit 549fdc
                  (char **result, const char *format, ...));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (asprintf);
Packit 549fdc
# if @REPLACE_VASPRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define vasprintf rpl_vasprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (vasprintf, int,
Packit 549fdc
                  (char **result, const char *format, va_list args)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (vasprintf, int,
Packit 549fdc
                  (char **result, const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_VASPRINTF@
Packit 549fdc
_GL_FUNCDECL_SYS (vasprintf, int,
Packit 549fdc
                  (char **result, const char *format, va_list args)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (vasprintf, int,
Packit 549fdc
                  (char **result, const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (vasprintf);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_VDPRINTF@
Packit 549fdc
# if @REPLACE_VDPRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define vdprintf rpl_vdprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
Packit 549fdc
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
Packit 549fdc
                                 _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_VDPRINTF@
Packit 549fdc
_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
Packit 549fdc
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
Packit 549fdc
                                 _GL_ARG_NONNULL ((2)));
Packit 549fdc
#  endif
Packit 549fdc
/* Need to cast, because on Solaris, the third parameter will likely be
Packit 549fdc
                                                    __va_list args.  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST (vdprintf, int,
Packit 549fdc
                       (int fd, const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (vdprintf);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef vdprintf
Packit 549fdc
# if HAVE_RAW_DECL_VDPRINTF
Packit 549fdc
_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
Packit 549fdc
                 "use gnulib module vdprintf for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
Packit 549fdc
# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
Packit 549fdc
     || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define vfprintf rpl_vfprintf
Packit 549fdc
#  endif
Packit 549fdc
#  define GNULIB_overrides_vfprintf 1
Packit 549fdc
#  if @GNULIB_VFPRINTF_POSIX@
Packit 549fdc
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
Packit 549fdc
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
Packit 549fdc
                                 _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  else
Packit 549fdc
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
Packit 549fdc
                                 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
Packit 549fdc
                                 _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
/* Need to cast, because on Solaris, the third parameter is
Packit 549fdc
                                                      __va_list args
Packit 549fdc
   and GCC's fixincludes did not change this to __gnuc_va_list.  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST (vfprintf, int,
Packit 549fdc
                       (FILE *fp, const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (vfprintf);
Packit 549fdc
#endif
Packit 549fdc
#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
Packit 549fdc
# if !GNULIB_overrides_vfprintf
Packit 549fdc
#  undef vfprintf
Packit 549fdc
# endif
Packit 549fdc
/* Assume vfprintf is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module vfprintf-posix for portable "
Packit 549fdc
                      "POSIX compliance");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_VFSCANF@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef vfscanf
Packit 549fdc
#   define vfscanf rpl_vfscanf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (vfscanf, int,
Packit 549fdc
                  (FILE *stream, const char *format, va_list args)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (vfscanf, int,
Packit 549fdc
                  (FILE *stream, const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (vfscanf, int,
Packit 549fdc
                  (FILE *stream, const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (vfscanf);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
Packit 549fdc
# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
Packit 549fdc
     || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define vprintf rpl_vprintf
Packit 549fdc
#  endif
Packit 549fdc
#  define GNULIB_overrides_vprintf 1
Packit 549fdc
#  if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
Packit 549fdc
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
Packit 549fdc
                                _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
Packit 549fdc
                                _GL_ARG_NONNULL ((1)));
Packit 549fdc
#  else
Packit 549fdc
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
Packit 549fdc
                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
Packit 549fdc
                                _GL_ARG_NONNULL ((1)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
/* Need to cast, because on Solaris, the second parameter is
Packit 549fdc
                                                          __va_list args
Packit 549fdc
   and GCC's fixincludes did not change this to __gnuc_va_list.  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (vprintf);
Packit 549fdc
#endif
Packit 549fdc
#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
Packit 549fdc
# if !GNULIB_overrides_vprintf
Packit 549fdc
#  undef vprintf
Packit 549fdc
# endif
Packit 549fdc
/* Assume vprintf is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module vprintf-posix for portable "
Packit 549fdc
                 "POSIX compliance");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_VSCANF@
Packit 549fdc
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef vscanf
Packit 549fdc
#   define vscanf rpl_vscanf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
Packit 549fdc
                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
Packit 549fdc
                               _GL_ARG_NONNULL ((1)));
Packit 549fdc
_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (vscanf);
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_VSNPRINTF@
Packit 549fdc
# if @REPLACE_VSNPRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define vsnprintf rpl_vsnprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (vsnprintf, int,
Packit 549fdc
                  (char *str, size_t size, const char *format, va_list args)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
Packit 549fdc
                  _GL_ARG_NONNULL ((3)));
Packit 549fdc
_GL_CXXALIAS_RPL (vsnprintf, int,
Packit 549fdc
                  (char *str, size_t size, const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DECL_VSNPRINTF@
Packit 549fdc
_GL_FUNCDECL_SYS (vsnprintf, int,
Packit 549fdc
                  (char *str, size_t size, const char *format, va_list args)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
Packit 549fdc
                  _GL_ARG_NONNULL ((3)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (vsnprintf, int,
Packit 549fdc
                  (char *str, size_t size, const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (vsnprintf);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef vsnprintf
Packit 549fdc
# if HAVE_RAW_DECL_VSNPRINTF
Packit 549fdc
_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
Packit 549fdc
                 "use gnulib module vsnprintf for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#if @GNULIB_VSPRINTF_POSIX@
Packit 549fdc
# if @REPLACE_VSPRINTF@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   define vsprintf rpl_vsprintf
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (vsprintf, int,
Packit 549fdc
                  (char *str, const char *format, va_list args)
Packit 549fdc
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
Packit 549fdc
                  _GL_ARG_NONNULL ((1, 2)));
Packit 549fdc
_GL_CXXALIAS_RPL (vsprintf, int,
Packit 549fdc
                  (char *str, const char *format, va_list args));
Packit 549fdc
# else
Packit 549fdc
/* Need to cast, because on Solaris, the third parameter is
Packit 549fdc
                                                       __va_list args
Packit 549fdc
   and GCC's fixincludes did not change this to __gnuc_va_list.  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST (vsprintf, int,
Packit 549fdc
                       (char *str, const char *format, va_list args));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (vsprintf);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef vsprintf
Packit 549fdc
/* Assume vsprintf is always declared.  */
Packit 549fdc
_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
Packit 549fdc
                 "use gnulib module vsprintf-posix for portable "
Packit 549fdc
                      "POSIX compliance");
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#endif /* _@GUARD_PREFIX@_STDIO_H */
Packit 549fdc
#endif /* _@GUARD_PREFIX@_STDIO_H */
Packit 549fdc
#endif