1 // Compatibility symbols for previous versions -*- C++ -*-
4 // Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 2, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING. If not, write to the Free
19 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 // As a special exception, you may use this file as part of a free software
23 // library without restriction. Specifically, if other files instantiate
24 // templates or use macros or inline functions from this file, or you compile
25 // this file and link it with other files to produce an executable, this
26 // file does not by itself cause the resulting executable to be covered by
27 // the GNU General Public License. This exception does not however
28 // invalidate any other reasons why the executable file might be covered by
29 // the GNU General Public License.
31 #include <bits/c++config.h>
33 #if defined(_GLIBCXX_SYMVER) && defined(PIC)
34 #define istreambuf_iterator istreambuf_iteratorXX
35 #define basic_fstream basic_fstreamXX
36 #define basic_ifstream basic_ifstreamXX
37 #define basic_ofstream basic_ofstreamXX
38 #define _M_copy(a, b, c) _M_copyXX(a, b, c)
39 #define _M_move(a, b, c) _M_moveXX(a, b, c)
40 #define _M_assign(a, b, c) _M_assignXX(a, b, c)
41 #define _M_disjunct(a) _M_disjunctXX(a)
42 #define _M_check_length(a, b, c) _M_check_lengthXX(a, b, c)
43 #define _M_set_length_and_sharable(a) _M_set_length_and_sharableXX(a)
44 #define ignore ignoreXX
55 // std::istream ignore explicit specializations.
60 ignore(streamsize __n
)
66 sentry
__cerb(*this, true);
67 if (__cerb
&& __n
> 0)
69 ios_base::iostate __err
= ios_base::iostate(ios_base::goodbit
);
72 const int_type __eof
= traits_type::eof();
73 __streambuf_type
* __sb
= this->rdbuf();
74 int_type __c
= __sb
->sgetc();
76 // See comment in istream.tcc.
77 bool __large_ignore
= false;
80 while (_M_gcount
< __n
81 && !traits_type::eq_int_type(__c
, __eof
))
83 streamsize __size
= std::min(streamsize(__sb
->egptr()
85 streamsize(__n
- _M_gcount
));
98 if (__n
== numeric_limits
<streamsize
>::max()
99 && !traits_type::eq_int_type(__c
, __eof
))
101 _M_gcount
= numeric_limits
<streamsize
>::min();
102 __large_ignore
= true;
109 _M_gcount
= numeric_limits
<streamsize
>::max();
111 if (traits_type::eq_int_type(__c
, __eof
))
112 __err
|= ios_base::eofbit
;
115 { this->_M_setstate(ios_base::badbit
); }
117 this->setstate(__err
);
122 #ifdef _GLIBCXX_USE_WCHAR_T
124 basic_istream
<wchar_t>&
125 basic_istream
<wchar_t>::
126 ignore(streamsize __n
)
132 sentry
__cerb(*this, true);
133 if (__cerb
&& __n
> 0)
135 ios_base::iostate __err
= ios_base::iostate(ios_base::goodbit
);
138 const int_type __eof
= traits_type::eof();
139 __streambuf_type
* __sb
= this->rdbuf();
140 int_type __c
= __sb
->sgetc();
142 bool __large_ignore
= false;
145 while (_M_gcount
< __n
146 && !traits_type::eq_int_type(__c
, __eof
))
148 streamsize __size
= std::min(streamsize(__sb
->egptr()
150 streamsize(__n
- _M_gcount
));
160 __c
= __sb
->snextc();
163 if (__n
== numeric_limits
<streamsize
>::max()
164 && !traits_type::eq_int_type(__c
, __eof
))
166 _M_gcount
= numeric_limits
<streamsize
>::min();
167 __large_ignore
= true;
174 _M_gcount
= numeric_limits
<streamsize
>::max();
176 if (traits_type::eq_int_type(__c
, __eof
))
177 __err
|= ios_base::eofbit
;
180 { this->_M_setstate(ios_base::badbit
); }
182 this->setstate(__err
);
189 // NB: These symbols renames should go into the shared library only,
190 // and only those shared libraries that support versioning.
191 #if defined(_GLIBCXX_SYMVER) && defined(PIC)
194 _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
195 _ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv
200 istreambuf_iterator
<char>&
201 istreambuf_iterator
<char>::operator++();
203 #ifdef _GLIBCXX_USE_WCHAR_T
205 istreambuf_iterator
<wchar_t>&
206 istreambuf_iterator
<wchar_t>::operator++();
211 _ZNSs4_Rep26_M_set_length_and_sharableEj
215 _ZNKSs11_M_disjunctEPKc
216 _ZNKSs15_M_check_lengthEjjPKc
217 _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEj
218 _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwj
219 _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwj
220 _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw
221 _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw
222 _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEjjPKc
224 _ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv
225 _ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv
226 _ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv
227 _ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv
228 _ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv
229 _ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv
233 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEi
234 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv
236 _ZNSt11char_traitsIcE2eqERKcS2_
237 _ZNSt11char_traitsIwE2eqERKwS2_
241 // std::char_traits is explicitly specialized
242 bool (* __p1
)(const char&, const char&) = &char_traits
<char>::eq
;
247 basic_string
<char>::_M_copy(char*, const char*, size_t);
251 basic_string
<char>::_M_move(char*, const char*, size_t);
255 basic_string
<char>::_M_assign(char*, size_t, char);
259 basic_string
<char>::_M_disjunct(const char*) const;
263 basic_string
<char>::_M_check_length(size_t, size_t, const char*) const;
267 basic_string
<char>::_Rep::_M_set_length_and_sharable(size_t);
273 basic_istream
<char>::ignore();
277 basic_fstream
<char>::is_open() const;
281 basic_ifstream
<char>::is_open() const;
285 basic_ofstream
<char>::is_open() const;
287 #ifdef _GLIBCXX_USE_WCHAR_T
288 bool (* __p2
)(const wchar_t&, const wchar_t&) = &char_traits
<wchar_t>::eq
;
293 basic_string
<wchar_t>::_M_copy(wchar_t*, const wchar_t*, size_t);
297 basic_string
<wchar_t>::_M_move(wchar_t*, const wchar_t*, size_t);
301 basic_string
<wchar_t>::_M_assign(wchar_t*, size_t, wchar_t);
305 basic_string
<wchar_t>::_M_disjunct(const wchar_t*) const;
309 basic_string
<wchar_t>::_M_check_length(size_t, size_t,
314 basic_string
<wchar_t>::_Rep::_M_set_length_and_sharable(size_t);
317 basic_istream
<wchar_t>&
318 basic_istream
<wchar_t>::ignore();
322 basic_fstream
<wchar_t>::is_open() const;
326 basic_ifstream
<wchar_t>::is_open() const;
330 basic_ofstream
<wchar_t>::is_open() const;
334 // The rename syntax for default exported names is
335 // asm (".symver name1,exportedname@GLIBCXX_3.4")
336 // asm (".symver name2,exportedname@@GLIBCXX_3.4.5")
337 // In the future, GLIBCXX_ABI > 6 should remove all uses of
338 // _GLIBCXX_*_SYMVER macros in this file.
340 #define _GLIBCXX_3_4_SYMVER(XXname, name) \
343 __attribute__ ((alias(#XXname))); \
344 asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4");
346 #define _GLIBCXX_3_4_5_SYMVER(XXname, name) \
349 __attribute__ ((alias(#XXname))); \
350 asm (".symver " "_Y" #name "," #name "@@GLIBCXX_3.4.5");
352 #define _GLIBCXX_ASM_SYMVER(cur, old, version) \
353 asm (".symver " #cur "," #old "@@" #version);
355 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_SYMVER
356 #include <bits/compatibility.h>
357 #undef _GLIBCXX_APPLY_SYMVER
359 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_5_SYMVER
360 #include <bits/compatibility.h>
361 #undef _GLIBCXX_APPLY_SYMVER
366 #if (defined(__ppc__) || defined (__ppc64__)) && defined (PIC)
367 /* __eprintf shouldn't have been made visible from libstdc++, or
368 anywhere, but on Mac OS X 10.4 it was defined in
369 libstdc++.6.0.3.dylib; so on that platform we have to keep defining
370 it to keep binary compatibility. We can't just put the libgcc
371 version in the export list, because that doesn't work; once a
372 symbol is marked as hidden, it stays that way. */
380 __eprintf (const char *string
, const char *expression
,
381 unsigned int line
, const char *filename
)
383 fprintf (stderr
, string
, expression
, line
, filename
);
388 #endif /* __APPLE__ */