]>
Commit | Line | Data |
---|---|---|
98e6e789 | 1 | // -*- C++ -*- forwarding header. |
22aef514 | 2 | |
7adcbafe | 3 | // Copyright (C) 1997-2022 Free Software Foundation, Inc. |
22aef514 BK |
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 | |
748086b7 | 8 | // Free Software Foundation; either version 3, or (at your option) |
22aef514 BK |
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 | ||
748086b7 JJ |
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. | |
22aef514 | 19 | |
748086b7 JJ |
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/>. | |
22aef514 | 24 | |
143c27b0 | 25 | /** @file include/cstdio |
ffe94f83 | 26 | * This is a Standard C++ Library file. You should @c #include this file |
2a60a9f6 | 27 | * in your programs, rather than any of the @a *.h implementation files. |
ffe94f83 PE |
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 | |
097588e4 PC |
31 | * contained in the namespace @c std (except for names which are defined |
32 | * as macros in C). | |
ffe94f83 PE |
33 | */ |
34 | ||
143c27b0 BK |
35 | // |
36 | // ISO C++ 14882: 27.8.2 C Library files | |
37 | // | |
38 | ||
1143680e SE |
39 | #ifndef _GLIBCXX_CSTDIO |
40 | #define _GLIBCXX_CSTDIO 1 | |
34ff0b99 BK |
41 | |
42 | #pragma GCC system_header | |
22aef514 | 43 | |
61c71946 | 44 | #include <bits/c++config.h> |
c0dae541 | 45 | #include <stdio.h> |
98e6e789 | 46 | |
36105dbd | 47 | #if __cplusplus <= 201103L && !defined(_GLIBCXX_HAVE_GETS) |
13fc08e4 | 48 | extern "C" char* gets (char* __s) __attribute__((__deprecated__)); |
1b6ce36f BK |
49 | #endif |
50 | ||
98e6e789 | 51 | // Get rid of those macros defined in <stdio.h> in lieu of real functions. |
61c71946 | 52 | #undef clearerr |
8089616e | 53 | #undef fclose |
61c71946 BK |
54 | #undef feof |
55 | #undef ferror | |
8089616e | 56 | #undef fflush |
8089616e | 57 | #undef fgetc |
61c71946 | 58 | #undef fgetpos |
8089616e | 59 | #undef fgets |
61c71946 BK |
60 | #undef fopen |
61 | #undef fprintf | |
8089616e BK |
62 | #undef fputc |
63 | #undef fputs | |
61c71946 BK |
64 | #undef fread |
65 | #undef freopen | |
66 | #undef fscanf | |
67 | #undef fseek | |
68 | #undef fsetpos | |
69 | #undef ftell | |
70 | #undef fwrite | |
98e6e789 BK |
71 | #undef getc |
72 | #undef getchar | |
acd1cc4b PC |
73 | #if __cplusplus <= 201103L |
74 | # undef gets | |
75 | #endif | |
61c71946 BK |
76 | #undef perror |
77 | #undef printf | |
98e6e789 BK |
78 | #undef putc |
79 | #undef putchar | |
8089616e | 80 | #undef puts |
61c71946 BK |
81 | #undef remove |
82 | #undef rename | |
8089616e | 83 | #undef rewind |
61c71946 BK |
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 | |
98e6e789 | 95 | |
12ffa228 BK |
96 | namespace std |
97 | { | |
98e6e789 BK |
98 | using ::FILE; |
99 | using ::fpos_t; | |
100 | ||
61c71946 | 101 | using ::clearerr; |
de96ac46 | 102 | using ::fclose; |
61c71946 BK |
103 | using ::feof; |
104 | using ::ferror; | |
de96ac46 | 105 | using ::fflush; |
de96ac46 | 106 | using ::fgetc; |
61c71946 | 107 | using ::fgetpos; |
de96ac46 | 108 | using ::fgets; |
61c71946 BK |
109 | using ::fopen; |
110 | using ::fprintf; | |
de96ac46 BK |
111 | using ::fputc; |
112 | using ::fputs; | |
61c71946 BK |
113 | using ::fread; |
114 | using ::freopen; | |
115 | using ::fscanf; | |
116 | using ::fseek; | |
117 | using ::fsetpos; | |
118 | using ::ftell; | |
119 | using ::fwrite; | |
de96ac46 BK |
120 | using ::getc; |
121 | using ::getchar; | |
acd1cc4b | 122 | #if __cplusplus <= 201103L |
ff84dbcb | 123 | // LWG 2249 |
de96ac46 | 124 | using ::gets; |
acd1cc4b | 125 | #endif |
61c71946 BK |
126 | using ::perror; |
127 | using ::printf; | |
de96ac46 BK |
128 | using ::putc; |
129 | using ::putchar; | |
130 | using ::puts; | |
61c71946 BK |
131 | using ::remove; |
132 | using ::rename; | |
de96ac46 | 133 | using ::rewind; |
61c71946 BK |
134 | using ::scanf; |
135 | using ::setbuf; | |
136 | using ::setvbuf; | |
137 | using ::sprintf; | |
138 | using ::sscanf; | |
139 | using ::tmpfile; | |
140 | using ::tmpnam; | |
141 | using ::ungetc; | |
142 | using ::vfprintf; | |
143 | using ::vprintf; | |
144 | using ::vsprintf; | |
12ffa228 | 145 | } // namespace std |
61c71946 | 146 | |
23c64853 | 147 | #if _GLIBCXX_USE_C99_STDIO |
61c71946 BK |
148 | |
149 | #undef snprintf | |
150 | #undef vfscanf | |
151 | #undef vscanf | |
152 | #undef vsnprintf | |
153 | #undef vsscanf | |
154 | ||
12ffa228 BK |
155 | namespace __gnu_cxx |
156 | { | |
3d7c150e | 157 | #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC |
9c594837 | 158 | extern "C" int |
f2871ffd PC |
159 | (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...) |
160 | throw (); | |
9c594837 | 161 | extern "C" int |
f2871ffd PC |
162 | (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list); |
163 | extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list); | |
9c594837 | 164 | extern "C" int |
f2871ffd | 165 | (vsnprintf)(char * __restrict, std::size_t, const char * __restrict, |
8fc81078 | 166 | __gnuc_va_list) throw (); |
9c594837 | 167 | extern "C" int |
f2871ffd | 168 | (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list) |
1cae1c5f | 169 | throw (); |
9c594837 | 170 | #endif |
347669a0 | 171 | |
3d7c150e | 172 | #if !_GLIBCXX_USE_C99_DYNAMIC |
61c71946 BK |
173 | using ::snprintf; |
174 | using ::vfscanf; | |
175 | using ::vscanf; | |
176 | using ::vsnprintf; | |
177 | using ::vsscanf; | |
9c594837 | 178 | #endif |
12ffa228 | 179 | } // namespace __gnu_cxx |
3cbc7af0 | 180 | |
12ffa228 BK |
181 | namespace std |
182 | { | |
3cbc7af0 BK |
183 | using ::__gnu_cxx::snprintf; |
184 | using ::__gnu_cxx::vfscanf; | |
185 | using ::__gnu_cxx::vscanf; | |
186 | using ::__gnu_cxx::vsnprintf; | |
187 | using ::__gnu_cxx::vsscanf; | |
12ffa228 | 188 | } // namespace std |
3cbc7af0 | 189 | |
7dd8177f | 190 | #endif |
22aef514 | 191 | |
98e6e789 | 192 | #endif |