Update Gnulib to the latest git version
[deliverable/binutils-gdb.git] / gnulib / import / stdio.in.h
index 9b313656c572d3cfd6813f86f0c7fbafd91f8ad9..92328bf20c0cafbef3716af5d32125995ce900e2 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2019 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
   _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
 
-/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
+/* Solaris 10 and NetBSD 7.0 declare renameat in <unistd.h>, not in <stdio.h>.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
-#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && (defined __sun || defined __NetBSD__) \
     && ! defined __GLIBC__
 # include <unistd.h>
 #endif
 
+/* Android 4.3 declares renameat in <sys/stat.h>, not in <stdio.h>.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+    && ! defined __GLIBC__
+# include <sys/stat.h>
+#endif
+
+/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>.  We must include
+   it before we  #define perror rpl_perror.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
+    && (defined _WIN32 && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <stdlib.h>
+#endif
+
+/* MSVC declares 'remove' in <io.h>, not in <stdio.h>.  We must include
+   it before we  #define remove rpl_remove.  */
+/* MSVC declares 'rename' in <io.h>, not in <stdio.h>.  We must include
+   it before we  #define rename rpl_rename.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
+    && (defined _WIN32 && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <io.h>
+#endif
+
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* When also using extern inline, suppress the use of static inline in
    standard headers of problematic Apple configurations, as Libc at
    least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
-   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
    Perhaps Apple will fix this some day.  */
 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
      && defined __GNUC__ && defined __STDC__)
@@ -176,7 +203,9 @@ _GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fclose);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fclose
 /* Assume fclose is always declared.  */
@@ -220,7 +249,9 @@ _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
 # else
 _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fflush);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fflush
 /* Assume fflush is always declared.  */
@@ -239,7 +270,9 @@ _GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fgetc);
+# endif
 #endif
 
 #if @GNULIB_FGETS@
@@ -254,7 +287,9 @@ _GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fgets);
+# endif
 #endif
 
 #if @GNULIB_FOPEN@
@@ -269,7 +304,9 @@ _GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
 # else
 _GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fopen);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fopen
 /* Assume fopen is always declared.  */
@@ -297,7 +334,9 @@ _GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
 # else
 _GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fprintf);
+# endif
 #endif
 #if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 # if !GNULIB_overrides_fprintf
@@ -348,7 +387,9 @@ _GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fputc);
+# endif
 #endif
 
 #if @GNULIB_FPUTS@
@@ -363,7 +404,9 @@ _GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fputs);
+# endif
 #endif
 
 #if @GNULIB_FREAD@
@@ -378,7 +421,9 @@ _GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fread);
+# endif
 #endif
 
 #if @GNULIB_FREOPEN@
@@ -396,7 +441,9 @@ _GL_CXXALIAS_RPL (freopen, FILE *,
 _GL_CXXALIAS_SYS (freopen, FILE *,
                   (const char *filename, const char *mode, FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (freopen);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef freopen
 /* Assume freopen is always declared.  */
@@ -418,7 +465,9 @@ _GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
 # else
 _GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fscanf);
+# endif
 #endif
 
 
@@ -469,7 +518,9 @@ _GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
 # else
 _GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fseek);
+# endif
 #endif
 
 #if @GNULIB_FSEEKO@
@@ -532,7 +583,9 @@ _GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
 # else
 _GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (ftell);
+# endif
 #endif
 
 #if @GNULIB_FTELLO@
@@ -590,7 +643,7 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
                   (const void *ptr, size_t s, size_t n, FILE *stream));
 
 /* Work around bug 11959 when fortifying glibc 2.4 through 2.15
-   <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
+   <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>,
    which sometimes causes an unwanted diagnostic for fwrite calls.
    This affects only function declaration attributes under certain
    versions of gcc and clang, and is not needed for C++.  */
@@ -612,7 +665,9 @@ extern size_t __REDIRECT (rpl_fwrite_unlocked,
 #   define fwrite_unlocked rpl_fwrite_unlocked
 #  endif
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fwrite);
+# endif
 #endif
 
 #if @GNULIB_GETC@
@@ -626,7 +681,9 @@ _GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
 # else
 _GL_CXXALIAS_SYS (getc, int, (FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (getc);
+# endif
 #endif
 
 #if @GNULIB_GETCHAR@
@@ -640,7 +697,9 @@ _GL_CXXALIAS_RPL (getchar, int, (void));
 # else
 _GL_CXXALIAS_SYS (getchar, int, (void));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (getchar);
+# endif
 #endif
 
 #if @GNULIB_GETDELIM@
@@ -805,7 +864,9 @@ _GL_CXXALIAS_RPL (perror, void, (const char *string));
 # else
 _GL_CXXALIAS_SYS (perror, void, (const char *string));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (perror);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef perror
 /* Assume perror is always declared.  */
@@ -876,7 +937,9 @@ _GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
 # else
 _GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (printf);
+# endif
 #endif
 #if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 # if !GNULIB_overrides_printf
@@ -899,7 +962,9 @@ _GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
 # else
 _GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (putc);
+# endif
 #endif
 
 #if @GNULIB_PUTCHAR@
@@ -913,7 +978,9 @@ _GL_CXXALIAS_RPL (putchar, int, (int c));
 # else
 _GL_CXXALIAS_SYS (putchar, int, (int c));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (putchar);
+# endif
 #endif
 
 #if @GNULIB_PUTS@
@@ -927,7 +994,9 @@ _GL_CXXALIAS_RPL (puts, int, (const char *string));
 # else
 _GL_CXXALIAS_SYS (puts, int, (const char *string));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (puts);
+# endif
 #endif
 
 #if @GNULIB_REMOVE@
@@ -941,7 +1010,9 @@ _GL_CXXALIAS_RPL (remove, int, (const char *name));
 # else
 _GL_CXXALIAS_SYS (remove, int, (const char *name));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (remove);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef remove
 /* Assume remove is always declared.  */
@@ -964,7 +1035,9 @@ _GL_CXXALIAS_RPL (rename, int,
 _GL_CXXALIAS_SYS (rename, int,
                   (const char *old_filename, const char *new_filename));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (rename);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef rename
 /* Assume rename is always declared.  */
@@ -1029,7 +1102,9 @@ _GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
 # else
 _GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (scanf);
+# endif
 #endif
 
 #if @GNULIB_SNPRINTF@
@@ -1083,7 +1158,9 @@ _GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
 # else
 _GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (sprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef sprintf
 /* Assume sprintf is always declared.  */
@@ -1102,7 +1179,9 @@ _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
 # else
 _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (tmpfile);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef tmpfile
 # if HAVE_RAW_DECL_TMPFILE
@@ -1180,7 +1259,9 @@ _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
 _GL_CXXALIAS_SYS_CAST (vdprintf, int,
                        (int fd, const char *format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vdprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef vdprintf
 # if HAVE_RAW_DECL_VDPRINTF
@@ -1213,7 +1294,9 @@ _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
 _GL_CXXALIAS_SYS_CAST (vfprintf, int,
                        (FILE *fp, const char *format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vfprintf);
+# endif
 #endif
 #if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 # if !GNULIB_overrides_vfprintf
@@ -1267,7 +1350,9 @@ _GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
    and GCC's fixincludes did not change this to __gnuc_va_list.  */
 _GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vprintf);
+# endif
 #endif
 #if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 # if !GNULIB_overrides_vprintf
@@ -1343,7 +1428,9 @@ _GL_CXXALIAS_RPL (vsprintf, int,
 _GL_CXXALIAS_SYS_CAST (vsprintf, int,
                        (char *str, const char *format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vsprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef vsprintf
 /* Assume vsprintf is always declared.  */
This page took 0.028499 seconds and 4 git commands to generate.