1 // Compatibility symbols for previous versions -*- C++ -*-
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009
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 3, 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 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
26 #include <bits/c++config.h>
28 #if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
29 && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
30 #define istreambuf_iterator istreambuf_iteratorXX
31 #define basic_fstream basic_fstreamXX
32 #define basic_ifstream basic_ifstreamXX
33 #define basic_ofstream basic_ofstreamXX
34 #define _M_copy(a, b, c) _M_copyXX(a, b, c)
35 #define _M_move(a, b, c) _M_moveXX(a, b, c)
36 #define _M_assign(a, b, c) _M_assignXX(a, b, c)
37 #define _M_disjunct(a) _M_disjunctXX(a)
38 #define _M_check_length(a, b, c) _M_check_lengthXX(a, b, c)
39 #define _M_set_length_and_sharable(a) _M_set_length_and_sharableXX(a)
40 #define ignore ignoreXX
42 #define _List_node_base _List_node_baseXX
50 #include <ext/numeric_traits.h>
52 _GLIBCXX_BEGIN_NAMESPACE(std
)
54 // std::istream ignore explicit specializations.
58 ignore(streamsize __n
)
64 sentry
__cerb(*this, true);
65 if (__cerb
&& __n
> 0)
67 ios_base::iostate __err
= ios_base::iostate(ios_base::goodbit
);
70 const int_type __eof
= traits_type::eof();
71 __streambuf_type
* __sb
= this->rdbuf();
72 int_type __c
= __sb
->sgetc();
74 // See comment in istream.tcc.
75 bool __large_ignore
= false;
78 while (_M_gcount
< __n
79 && !traits_type::eq_int_type(__c
, __eof
))
81 streamsize __size
= std::min(streamsize(__sb
->egptr()
83 streamsize(__n
- _M_gcount
));
96 if (__n
== __gnu_cxx::__numeric_traits
<streamsize
>::__max
97 && !traits_type::eq_int_type(__c
, __eof
))
100 __gnu_cxx::__numeric_traits
<streamsize
>::__min
;
101 __large_ignore
= true;
108 _M_gcount
= __gnu_cxx::__numeric_traits
<streamsize
>::__max
;
110 if (traits_type::eq_int_type(__c
, __eof
))
111 __err
|= ios_base::eofbit
;
113 __catch(__cxxabiv1::__forced_unwind
&)
115 this->_M_setstate(ios_base::badbit
);
116 __throw_exception_again
;
119 { this->_M_setstate(ios_base::badbit
); }
121 this->setstate(__err
);
126 #ifdef _GLIBCXX_USE_WCHAR_T
128 basic_istream
<wchar_t>&
129 basic_istream
<wchar_t>::
130 ignore(streamsize __n
)
136 sentry
__cerb(*this, true);
137 if (__cerb
&& __n
> 0)
139 ios_base::iostate __err
= ios_base::iostate(ios_base::goodbit
);
142 const int_type __eof
= traits_type::eof();
143 __streambuf_type
* __sb
= this->rdbuf();
144 int_type __c
= __sb
->sgetc();
146 bool __large_ignore
= false;
149 while (_M_gcount
< __n
150 && !traits_type::eq_int_type(__c
, __eof
))
152 streamsize __size
= std::min(streamsize(__sb
->egptr()
154 streamsize(__n
- _M_gcount
));
164 __c
= __sb
->snextc();
167 if (__n
== __gnu_cxx::__numeric_traits
<streamsize
>::__max
168 && !traits_type::eq_int_type(__c
, __eof
))
171 __gnu_cxx::__numeric_traits
<streamsize
>::__min
;
172 __large_ignore
= true;
179 _M_gcount
= __gnu_cxx::__numeric_traits
<streamsize
>::__max
;
181 if (traits_type::eq_int_type(__c
, __eof
))
182 __err
|= ios_base::eofbit
;
184 __catch(__cxxabiv1::__forced_unwind
&)
186 this->_M_setstate(ios_base::badbit
);
187 __throw_exception_again
;
190 { this->_M_setstate(ios_base::badbit
); }
192 this->setstate(__err
);
198 _GLIBCXX_END_NAMESPACE
201 // NB: These symbols renames should go into the shared library only,
202 // and only those shared libraries that support versioning.
203 #if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
204 && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
207 _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
208 _ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv
211 _GLIBCXX_BEGIN_NAMESPACE(std
)
214 istreambuf_iterator
<char>&
215 istreambuf_iterator
<char>::operator++();
217 #ifdef _GLIBCXX_USE_WCHAR_T
219 istreambuf_iterator
<wchar_t>&
220 istreambuf_iterator
<wchar_t>::operator++();
223 _GLIBCXX_END_NAMESPACE
227 _ZNSs4_Rep26_M_set_length_and_sharableEj
231 _ZNKSs11_M_disjunctEPKc
232 _ZNKSs15_M_check_lengthEjjPKc
233 _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEj
234 _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwj
235 _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwj
236 _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw
237 _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw
238 _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEjjPKc
240 _ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv
241 _ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv
242 _ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv
243 _ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv
244 _ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv
245 _ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv
249 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEi
250 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv
252 _ZNSt11char_traitsIcE2eqERKcS2_
253 _ZNSt11char_traitsIwE2eqERKwS2_
255 _GLIBCXX_BEGIN_NAMESPACE(std
)
257 // std::char_traits is explicitly specialized
258 bool (* __p1
)(const char&, const char&) = &char_traits
<char>::eq
;
263 basic_string
<char>::_M_copy(char*, const char*, size_t);
267 basic_string
<char>::_M_move(char*, const char*, size_t);
271 basic_string
<char>::_M_assign(char*, size_t, char);
275 basic_string
<char>::_M_disjunct(const char*) const;
279 basic_string
<char>::_M_check_length(size_t, size_t, const char*) const;
283 basic_string
<char>::_Rep::_M_set_length_and_sharable(size_t);
289 basic_istream
<char>::ignore();
293 basic_fstream
<char>::is_open() const;
297 basic_ifstream
<char>::is_open() const;
301 basic_ofstream
<char>::is_open() const;
303 #ifdef _GLIBCXX_USE_WCHAR_T
304 bool (* __p2
)(const wchar_t&, const wchar_t&) = &char_traits
<wchar_t>::eq
;
309 basic_string
<wchar_t>::_M_copy(wchar_t*, const wchar_t*, size_t);
313 basic_string
<wchar_t>::_M_move(wchar_t*, const wchar_t*, size_t);
317 basic_string
<wchar_t>::_M_assign(wchar_t*, size_t, wchar_t);
321 basic_string
<wchar_t>::_M_disjunct(const wchar_t*) const;
325 basic_string
<wchar_t>::_M_check_length(size_t, size_t,
330 basic_string
<wchar_t>::_Rep::_M_set_length_and_sharable(size_t);
333 basic_istream
<wchar_t>&
334 basic_istream
<wchar_t>::ignore();
338 basic_fstream
<wchar_t>::is_open() const;
342 basic_ifstream
<wchar_t>::is_open() const;
346 basic_ofstream
<wchar_t>::is_open() const;
349 _GLIBCXX_END_NAMESPACE
351 // The rename syntax for default exported names is
352 // asm (".symver name1,exportedname@GLIBCXX_3.4")
353 // asm (".symver name2,exportedname@@GLIBCXX_3.4.5")
354 // In the future, GLIBCXX_ABI > 6 should remove all uses of
355 // _GLIBCXX_*_SYMVER macros in this file.
357 #define _GLIBCXX_3_4_SYMVER(XXname, name) \
360 __attribute__ ((alias(#XXname))); \
361 asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4");
363 #define _GLIBCXX_3_4_5_SYMVER(XXname, name) \
366 __attribute__ ((alias(#XXname))); \
367 asm (".symver " "_Y" #name "," #name "@@GLIBCXX_3.4.5");
369 #define _GLIBCXX_ASM_SYMVER(cur, old, version) \
370 asm (".symver " #cur "," #old "@@" #version);
372 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_SYMVER
373 #include <bits/compatibility.h>
374 #undef _GLIBCXX_APPLY_SYMVER
376 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_5_SYMVER
377 #include <bits/compatibility.h>
378 #undef _GLIBCXX_APPLY_SYMVER
382 _ZN10__gnu_norm15_List_node_base4hookEPS0_;
383 _ZN10__gnu_norm15_List_node_base4swapERS0_S1_;
384 _ZN10__gnu_norm15_List_node_base6unhookEv;
385 _ZN10__gnu_norm15_List_node_base7reverseEv;
386 _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_;
389 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4hookEPS_
, \
390 _ZN10__gnu_norm15_List_node_base4hookEPS0_
, \
393 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4swapERS_S0_
, \
394 _ZN10__gnu_norm15_List_node_base4swapERS0_S1_
, \
397 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX6unhookEv
, \
398 _ZN10__gnu_norm15_List_node_base6unhookEv
, \
401 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX7reverseEv
, \
402 _ZN10__gnu_norm15_List_node_base7reverseEv
, \
405 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX8transferEPS_S0_
, \
406 _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_
, \
408 #undef _List_node_base
411 // Long double versions of "C" math functions.
412 #if defined (_GLIBCXX_LONG_DOUBLE_COMPAT) \
413 || (defined (__hppa__) && defined (__linux__))
415 #define _GLIBCXX_MATHL_WRAPPER(name, argdecl, args, ver) \
417 __ ## name ## l_wrapper argdecl \
421 asm (".symver __" #name "l_wrapper, " #name "l@" #ver)
423 #define _GLIBCXX_MATHL_WRAPPER1(name, ver) \
424 _GLIBCXX_MATHL_WRAPPER (name, (double x), (x), ver)
426 #define _GLIBCXX_MATHL_WRAPPER2(name, ver) \
427 _GLIBCXX_MATHL_WRAPPER (name, (double x, double y), (x, y), ver)
429 #ifdef _GLIBCXX_HAVE_ACOSL
430 _GLIBCXX_MATHL_WRAPPER1 (acos
, GLIBCXX_3
.4
.3);
432 #ifdef _GLIBCXX_HAVE_ASINL
433 _GLIBCXX_MATHL_WRAPPER1 (asin
, GLIBCXX_3
.4
.3);
435 #ifdef _GLIBCXX_HAVE_ATAN2L
436 _GLIBCXX_MATHL_WRAPPER2 (atan2
, GLIBCXX_3
.4
);
438 #ifdef _GLIBCXX_HAVE_ATANL
439 _GLIBCXX_MATHL_WRAPPER1 (atan
, GLIBCXX_3
.4
.3);
441 #ifdef _GLIBCXX_HAVE_CEILL
442 _GLIBCXX_MATHL_WRAPPER1 (ceil
, GLIBCXX_3
.4
.3);
444 #ifdef _GLIBCXX_HAVE_COSHL
445 _GLIBCXX_MATHL_WRAPPER1 (cosh
, GLIBCXX_3
.4
);
447 #ifdef _GLIBCXX_HAVE_COSL
448 _GLIBCXX_MATHL_WRAPPER1 (cos
, GLIBCXX_3
.4
);
450 #ifdef _GLIBCXX_HAVE_EXPL
451 _GLIBCXX_MATHL_WRAPPER1 (exp
, GLIBCXX_3
.4
);
453 #ifdef _GLIBCXX_HAVE_FLOORL
454 _GLIBCXX_MATHL_WRAPPER1 (floor
, GLIBCXX_3
.4
.3);
456 #ifdef _GLIBCXX_HAVE_FMODL
457 _GLIBCXX_MATHL_WRAPPER2 (fmod
, GLIBCXX_3
.4
.3);
459 #ifdef _GLIBCXX_HAVE_FREXPL
460 _GLIBCXX_MATHL_WRAPPER (frexp
, (double x
, int *y
), (x
, y
), GLIBCXX_3
.4
.3);
462 #ifdef _GLIBCXX_HAVE_HYPOTL
463 _GLIBCXX_MATHL_WRAPPER2 (hypot
, GLIBCXX_3
.4
);
465 #ifdef _GLIBCXX_HAVE_LDEXPL
466 _GLIBCXX_MATHL_WRAPPER (ldexp
, (double x
, int y
), (x
, y
), GLIBCXX_3
.4
.3);
468 #ifdef _GLIBCXX_HAVE_LOG10L
469 _GLIBCXX_MATHL_WRAPPER1 (log10
, GLIBCXX_3
.4
);
471 #ifdef _GLIBCXX_HAVE_LOGL
472 _GLIBCXX_MATHL_WRAPPER1 (log
, GLIBCXX_3
.4
);
474 #ifdef _GLIBCXX_HAVE_MODFL
475 _GLIBCXX_MATHL_WRAPPER (modf
, (double x
, double *y
), (x
, y
), GLIBCXX_3
.4
.3);
477 #ifdef _GLIBCXX_HAVE_POWL
478 _GLIBCXX_MATHL_WRAPPER2 (pow
, GLIBCXX_3
.4
);
480 #ifdef _GLIBCXX_HAVE_SINHL
481 _GLIBCXX_MATHL_WRAPPER1 (sinh
, GLIBCXX_3
.4
);
483 #ifdef _GLIBCXX_HAVE_SINL
484 _GLIBCXX_MATHL_WRAPPER1 (sin
, GLIBCXX_3
.4
);
486 #ifdef _GLIBCXX_HAVE_SQRTL
487 _GLIBCXX_MATHL_WRAPPER1 (sqrt
, GLIBCXX_3
.4
);
489 #ifdef _GLIBCXX_HAVE_TANHL
490 _GLIBCXX_MATHL_WRAPPER1 (tanh
, GLIBCXX_3
.4
);
492 #ifdef _GLIBCXX_HAVE_TANL
493 _GLIBCXX_MATHL_WRAPPER1 (tan
, GLIBCXX_3
.4
);
495 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
499 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
500 extern void *_ZTVN10__cxxabiv123__fundamental_type_infoE
[];
501 extern void *_ZTVN10__cxxabiv119__pointer_type_infoE
[];
502 extern __attribute__((used
, weak
)) const char _ZTSe
[2] = "e";
503 extern __attribute__((used
, weak
)) const char _ZTSPe
[3] = "Pe";
504 extern __attribute__((used
, weak
)) const char _ZTSPKe
[4] = "PKe";
505 extern __attribute__((used
, weak
)) const void *_ZTIe
[2]
506 = { (void *) &_ZTVN10__cxxabiv123__fundamental_type_infoE
[2],
508 extern __attribute__((used
, weak
)) const void *_ZTIPe
[4]
509 = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE
[2],
510 (void *) _ZTSPe
, (void *) 0L, (void *) _ZTIe
};
511 extern __attribute__((used
, weak
)) const void *_ZTIPKe
[4]
512 = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE
[2],
513 (void *) _ZTSPKe
, (void *) 1L, (void *) _ZTIe
};
514 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
518 #ifdef _GLIBCXX_SYMVER_DARWIN
519 #if (defined(__ppc__) || defined(__ppc64__)) && defined(PIC)
520 /* __eprintf shouldn't have been made visible from libstdc++, or
521 anywhere, but on Mac OS X 10.4 it was defined in
522 libstdc++.6.0.3.dylib; so on that platform we have to keep defining
523 it to keep binary compatibility. We can't just put the libgcc
524 version in the export list, because that doesn't work; once a
525 symbol is marked as hidden, it stays that way. */
533 __eprintf(const char *string
, const char *expression
,
534 unsigned int line
, const char *filename
)
536 fprintf(stderr
, string
, expression
, line
, filename
);