]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/include/c_global/cstdio
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / c_global / cstdio
CommitLineData
bec9a462 1// -*- C++ -*- forwarding header.
2
f1717362 3// Copyright (C) 1997-2016 Free Software Foundation, Inc.
bec9a462 4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
6bc9506f 8// Free Software Foundation; either version 3, or (at your option)
bec9a462 9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
6bc9506f 16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
bec9a462 24
25/** @file include/cstdio
73337dee 26 * This is a Standard C++ Library file. You should @c \#include this file
72117d76 27 * in your programs, rather than any of the @a *.h implementation files.
bec9a462 28 *
29 * This is the C++ version of the Standard C Library header @c stdio.h,
30 * and its contents are (mostly) the same as that header, but are all
31 * contained in the namespace @c std (except for names which are defined
32 * as macros in C).
33 */
34
35//
36// ISO C++ 14882: 27.8.2 C Library files
37//
38
39#pragma GCC system_header
40
41#include <bits/c++config.h>
2239ee44 42#include <stdio.h>
bec9a462 43
44#ifndef _GLIBCXX_CSTDIO
45#define _GLIBCXX_CSTDIO 1
46
b4eb4a64 47#ifndef _GLIBCXX_HAVE_GETS
1192d5db 48extern "C" char* gets (char* __s) __attribute__((__deprecated__));
b4eb4a64 49#endif
50
bec9a462 51// Get rid of those macros defined in <stdio.h> in lieu of real functions.
52#undef clearerr
53#undef fclose
54#undef feof
55#undef ferror
56#undef fflush
57#undef fgetc
58#undef fgetpos
59#undef fgets
60#undef fopen
61#undef fprintf
62#undef fputc
63#undef fputs
64#undef fread
65#undef freopen
66#undef fscanf
67#undef fseek
68#undef fsetpos
69#undef ftell
70#undef fwrite
71#undef getc
ca40ff87 72#undef getchar
6918f02c 73#if __cplusplus <= 201103L
74# undef gets
75#endif
bec9a462 76#undef perror
77#undef printf
78#undef putc
79#undef putchar
80#undef puts
81#undef remove
82#undef rename
83#undef rewind
84#undef scanf
85#undef setbuf
86#undef setvbuf
87#undef sprintf
88#undef sscanf
89#undef tmpfile
90#undef tmpnam
91#undef ungetc
92#undef vfprintf
93#undef vprintf
94#undef vsprintf
95
2948dd21 96namespace std
97{
bec9a462 98 using ::FILE;
99 using ::fpos_t;
100
101 using ::clearerr;
102 using ::fclose;
103 using ::feof;
104 using ::ferror;
105 using ::fflush;
106 using ::fgetc;
107 using ::fgetpos;
108 using ::fgets;
109 using ::fopen;
110 using ::fprintf;
111 using ::fputc;
112 using ::fputs;
113 using ::fread;
114 using ::freopen;
115 using ::fscanf;
116 using ::fseek;
117 using ::fsetpos;
118 using ::ftell;
119 using ::fwrite;
120 using ::getc;
121 using ::getchar;
6918f02c 122#if __cplusplus <= 201103L
aba73ec6 123 // LWG 2249
bec9a462 124 using ::gets;
6918f02c 125#endif
bec9a462 126 using ::perror;
127 using ::printf;
128 using ::putc;
129 using ::putchar;
130 using ::puts;
131 using ::remove;
132 using ::rename;
133 using ::rewind;
134 using ::scanf;
135 using ::setbuf;
136 using ::setvbuf;
137 using ::sprintf;
138 using ::sscanf;
139 using ::tmpfile;
e1150b06 140#if _GLIBCXX_USE_TMPNAM
bec9a462 141 using ::tmpnam;
e1150b06 142#endif
bec9a462 143 using ::ungetc;
144 using ::vfprintf;
145 using ::vprintf;
146 using ::vsprintf;
2948dd21 147} // namespace
bec9a462 148
bdb62e6a 149#if _GLIBCXX_USE_C99_STDIO
bec9a462 150
151#undef snprintf
152#undef vfscanf
153#undef vscanf
154#undef vsnprintf
155#undef vsscanf
156
2948dd21 157namespace __gnu_cxx
158{
bec9a462 159#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
160 extern "C" int
001a8872 161 (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...)
162 throw ();
bec9a462 163 extern "C" int
001a8872 164 (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list);
165 extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list);
bec9a462 166 extern "C" int
001a8872 167 (vsnprintf)(char * __restrict, std::size_t, const char * __restrict,
e4bb1925 168 __gnuc_va_list) throw ();
bec9a462 169 extern "C" int
001a8872 170 (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list)
2f1c2b41 171 throw ();
bec9a462 172#endif
173
174#if !_GLIBCXX_USE_C99_DYNAMIC
175 using ::snprintf;
176 using ::vfscanf;
177 using ::vscanf;
178 using ::vsnprintf;
179 using ::vsscanf;
180#endif
2948dd21 181} // namespace __gnu_cxx
bec9a462 182
2948dd21 183namespace std
184{
bec9a462 185 using ::__gnu_cxx::snprintf;
186 using ::__gnu_cxx::vfscanf;
187 using ::__gnu_cxx::vscanf;
188 using ::__gnu_cxx::vsnprintf;
189 using ::__gnu_cxx::vsscanf;
2948dd21 190} // namespace std
bec9a462 191
bdb62e6a 192#endif // _GLIBCXX_USE_C99_STDIO
bec9a462 193
bec9a462 194#endif