1 // Compatibility symbols for previous versions -*- C++ -*-
3 // Copyright (C) 2005, 2006, 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 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_GNU) && defined(PIC) \
34 && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
35 #define istreambuf_iterator istreambuf_iteratorXX
36 #define basic_fstream basic_fstreamXX
37 #define basic_ifstream basic_ifstreamXX
38 #define basic_ofstream basic_ofstreamXX
39 #define _M_copy(a, b, c) _M_copyXX(a, b, c)
40 #define _M_move(a, b, c) _M_moveXX(a, b, c)
41 #define _M_assign(a, b, c) _M_assignXX(a, b, c)
42 #define _M_disjunct(a) _M_disjunctXX(a)
43 #define _M_check_length(a, b, c) _M_check_lengthXX(a, b, c)
44 #define _M_set_length_and_sharable(a) _M_set_length_and_sharableXX(a)
45 #define ignore ignoreXX
47 #define _List_node_base _List_node_baseXX
55 #include <ext/numeric_traits.h>
57 _GLIBCXX_BEGIN_NAMESPACE(std
)
59 // std::istream ignore explicit specializations.
63 ignore(streamsize __n
)
69 sentry
__cerb(*this, true);
70 if (__cerb
&& __n
> 0)
72 ios_base::iostate __err
= ios_base::iostate(ios_base::goodbit
);
75 const int_type __eof
= traits_type::eof();
76 __streambuf_type
* __sb
= this->rdbuf();
77 int_type __c
= __sb
->sgetc();
79 // See comment in istream.tcc.
80 bool __large_ignore
= false;
83 while (_M_gcount
< __n
84 && !traits_type::eq_int_type(__c
, __eof
))
86 streamsize __size
= std::min(streamsize(__sb
->egptr()
88 streamsize(__n
- _M_gcount
));
101 if (__n
== __gnu_cxx::__numeric_traits
<streamsize
>::__max
102 && !traits_type::eq_int_type(__c
, __eof
))
105 __gnu_cxx::__numeric_traits
<streamsize
>::__min
;
106 __large_ignore
= true;
113 _M_gcount
= __gnu_cxx::__numeric_traits
<streamsize
>::__max
;
115 if (traits_type::eq_int_type(__c
, __eof
))
116 __err
|= ios_base::eofbit
;
118 catch(__cxxabiv1::__forced_unwind
&)
120 this->_M_setstate(ios_base::badbit
);
121 __throw_exception_again
;
124 { this->_M_setstate(ios_base::badbit
); }
126 this->setstate(__err
);
131 #ifdef _GLIBCXX_USE_WCHAR_T
133 basic_istream
<wchar_t>&
134 basic_istream
<wchar_t>::
135 ignore(streamsize __n
)
141 sentry
__cerb(*this, true);
142 if (__cerb
&& __n
> 0)
144 ios_base::iostate __err
= ios_base::iostate(ios_base::goodbit
);
147 const int_type __eof
= traits_type::eof();
148 __streambuf_type
* __sb
= this->rdbuf();
149 int_type __c
= __sb
->sgetc();
151 bool __large_ignore
= false;
154 while (_M_gcount
< __n
155 && !traits_type::eq_int_type(__c
, __eof
))
157 streamsize __size
= std::min(streamsize(__sb
->egptr()
159 streamsize(__n
- _M_gcount
));
169 __c
= __sb
->snextc();
172 if (__n
== __gnu_cxx::__numeric_traits
<streamsize
>::__max
173 && !traits_type::eq_int_type(__c
, __eof
))
176 __gnu_cxx::__numeric_traits
<streamsize
>::__min
;
177 __large_ignore
= true;
184 _M_gcount
= __gnu_cxx::__numeric_traits
<streamsize
>::__max
;
186 if (traits_type::eq_int_type(__c
, __eof
))
187 __err
|= ios_base::eofbit
;
189 catch(__cxxabiv1::__forced_unwind
&)
191 this->_M_setstate(ios_base::badbit
);
192 __throw_exception_again
;
195 { this->_M_setstate(ios_base::badbit
); }
197 this->setstate(__err
);
203 _GLIBCXX_END_NAMESPACE
206 // NB: These symbols renames should go into the shared library only,
207 // and only those shared libraries that support versioning.
208 #if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
209 && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
212 _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
213 _ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv
216 _GLIBCXX_BEGIN_NAMESPACE(std
)
219 istreambuf_iterator
<char>&
220 istreambuf_iterator
<char>::operator++();
222 #ifdef _GLIBCXX_USE_WCHAR_T
224 istreambuf_iterator
<wchar_t>&
225 istreambuf_iterator
<wchar_t>::operator++();
228 _GLIBCXX_END_NAMESPACE
232 _ZNSs4_Rep26_M_set_length_and_sharableEj
236 _ZNKSs11_M_disjunctEPKc
237 _ZNKSs15_M_check_lengthEjjPKc
238 _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEj
239 _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwj
240 _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwj
241 _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw
242 _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw
243 _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEjjPKc
245 _ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv
246 _ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv
247 _ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv
248 _ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv
249 _ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv
250 _ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv
254 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEi
255 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv
257 _ZNSt11char_traitsIcE2eqERKcS2_
258 _ZNSt11char_traitsIwE2eqERKwS2_
260 _GLIBCXX_BEGIN_NAMESPACE(std
)
262 // std::char_traits is explicitly specialized
263 bool (* __p1
)(const char&, const char&) = &char_traits
<char>::eq
;
268 basic_string
<char>::_M_copy(char*, const char*, size_t);
272 basic_string
<char>::_M_move(char*, const char*, size_t);
276 basic_string
<char>::_M_assign(char*, size_t, char);
280 basic_string
<char>::_M_disjunct(const char*) const;
284 basic_string
<char>::_M_check_length(size_t, size_t, const char*) const;
288 basic_string
<char>::_Rep::_M_set_length_and_sharable(size_t);
294 basic_istream
<char>::ignore();
298 basic_fstream
<char>::is_open() const;
302 basic_ifstream
<char>::is_open() const;
306 basic_ofstream
<char>::is_open() const;
308 #ifdef _GLIBCXX_USE_WCHAR_T
309 bool (* __p2
)(const wchar_t&, const wchar_t&) = &char_traits
<wchar_t>::eq
;
314 basic_string
<wchar_t>::_M_copy(wchar_t*, const wchar_t*, size_t);
318 basic_string
<wchar_t>::_M_move(wchar_t*, const wchar_t*, size_t);
322 basic_string
<wchar_t>::_M_assign(wchar_t*, size_t, wchar_t);
326 basic_string
<wchar_t>::_M_disjunct(const wchar_t*) const;
330 basic_string
<wchar_t>::_M_check_length(size_t, size_t,
335 basic_string
<wchar_t>::_Rep::_M_set_length_and_sharable(size_t);
338 basic_istream
<wchar_t>&
339 basic_istream
<wchar_t>::ignore();
343 basic_fstream
<wchar_t>::is_open() const;
347 basic_ifstream
<wchar_t>::is_open() const;
351 basic_ofstream
<wchar_t>::is_open() const;
354 _GLIBCXX_END_NAMESPACE
356 // The rename syntax for default exported names is
357 // asm (".symver name1,exportedname@GLIBCXX_3.4")
358 // asm (".symver name2,exportedname@@GLIBCXX_3.4.5")
359 // In the future, GLIBCXX_ABI > 6 should remove all uses of
360 // _GLIBCXX_*_SYMVER macros in this file.
362 #define _GLIBCXX_3_4_SYMVER(XXname, name) \
365 __attribute__ ((alias(#XXname))); \
366 asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4");
368 #define _GLIBCXX_3_4_5_SYMVER(XXname, name) \
371 __attribute__ ((alias(#XXname))); \
372 asm (".symver " "_Y" #name "," #name "@@GLIBCXX_3.4.5");
374 #define _GLIBCXX_ASM_SYMVER(cur, old, version) \
375 asm (".symver " #cur "," #old "@@" #version);
377 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_SYMVER
378 #include <bits/compatibility.h>
379 #undef _GLIBCXX_APPLY_SYMVER
381 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_5_SYMVER
382 #include <bits/compatibility.h>
383 #undef _GLIBCXX_APPLY_SYMVER
387 _ZN10__gnu_norm15_List_node_base4hookEPS0_;
388 _ZN10__gnu_norm15_List_node_base4swapERS0_S1_;
389 _ZN10__gnu_norm15_List_node_base6unhookEv;
390 _ZN10__gnu_norm15_List_node_base7reverseEv;
391 _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_;
394 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4hookEPS_
, \
395 _ZN10__gnu_norm15_List_node_base4hookEPS0_
, \
398 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4swapERS_S0_
, \
399 _ZN10__gnu_norm15_List_node_base4swapERS0_S1_
, \
402 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX6unhookEv
, \
403 _ZN10__gnu_norm15_List_node_base6unhookEv
, \
406 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX7reverseEv
, \
407 _ZN10__gnu_norm15_List_node_base7reverseEv
, \
410 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX8transferEPS_S0_
, \
411 _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_
, \
413 #undef _List_node_base
416 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
417 #define _GLIBCXX_MATHL_WRAPPER(name, argdecl, args, ver) \
419 __ ## name ## l_wrapper argdecl \
423 asm (".symver __" #name "l_wrapper, " #name "l@" #ver)
425 #define _GLIBCXX_MATHL_WRAPPER1(name, ver) \
426 _GLIBCXX_MATHL_WRAPPER (name, (double x), (x), ver)
428 #define _GLIBCXX_MATHL_WRAPPER2(name, ver) \
429 _GLIBCXX_MATHL_WRAPPER (name, (double x, double y), (x, y), ver)
431 #ifdef _GLIBCXX_HAVE_ACOSL
432 _GLIBCXX_MATHL_WRAPPER1 (acos
, GLIBCXX_3
.4
.3);
434 #ifdef _GLIBCXX_HAVE_ASINL
435 _GLIBCXX_MATHL_WRAPPER1 (asin
, GLIBCXX_3
.4
.3);
437 #ifdef _GLIBCXX_HAVE_ATAN2L
438 _GLIBCXX_MATHL_WRAPPER2 (atan2
, GLIBCXX_3
.4
);
440 #ifdef _GLIBCXX_HAVE_ATANL
441 _GLIBCXX_MATHL_WRAPPER1 (atan
, GLIBCXX_3
.4
.3);
443 #ifdef _GLIBCXX_HAVE_CEILL
444 _GLIBCXX_MATHL_WRAPPER1 (ceil
, GLIBCXX_3
.4
.3);
446 #ifdef _GLIBCXX_HAVE_COSHL
447 _GLIBCXX_MATHL_WRAPPER1 (cosh
, GLIBCXX_3
.4
);
449 #ifdef _GLIBCXX_HAVE_COSL
450 _GLIBCXX_MATHL_WRAPPER1 (cos
, GLIBCXX_3
.4
);
452 #ifdef _GLIBCXX_HAVE_EXPL
453 _GLIBCXX_MATHL_WRAPPER1 (exp
, GLIBCXX_3
.4
);
455 #ifdef _GLIBCXX_HAVE_FLOORL
456 _GLIBCXX_MATHL_WRAPPER1 (floor
, GLIBCXX_3
.4
.3);
458 #ifdef _GLIBCXX_HAVE_FMODL
459 _GLIBCXX_MATHL_WRAPPER2 (fmod
, GLIBCXX_3
.4
.3);
461 #ifdef _GLIBCXX_HAVE_FREXPL
462 _GLIBCXX_MATHL_WRAPPER (frexp
, (double x
, int *y
), (x
, y
), GLIBCXX_3
.4
.3);
464 #ifdef _GLIBCXX_HAVE_HYPOTL
465 _GLIBCXX_MATHL_WRAPPER2 (hypot
, GLIBCXX_3
.4
);
467 #ifdef _GLIBCXX_HAVE_LDEXPL
468 _GLIBCXX_MATHL_WRAPPER (ldexp
, (double x
, int y
), (x
, y
), GLIBCXX_3
.4
.3);
470 #ifdef _GLIBCXX_HAVE_LOG10L
471 _GLIBCXX_MATHL_WRAPPER1 (log10
, GLIBCXX_3
.4
);
473 #ifdef _GLIBCXX_HAVE_LOGL
474 _GLIBCXX_MATHL_WRAPPER1 (log
, GLIBCXX_3
.4
);
476 #ifdef _GLIBCXX_HAVE_MODFL
477 _GLIBCXX_MATHL_WRAPPER (modf
, (double x
, double *y
), (x
, y
), GLIBCXX_3
.4
.3);
479 #ifdef _GLIBCXX_HAVE_POWL
480 _GLIBCXX_MATHL_WRAPPER2 (pow
, GLIBCXX_3
.4
);
482 #ifdef _GLIBCXX_HAVE_SINHL
483 _GLIBCXX_MATHL_WRAPPER1 (sinh
, GLIBCXX_3
.4
);
485 #ifdef _GLIBCXX_HAVE_SINL
486 _GLIBCXX_MATHL_WRAPPER1 (sin
, GLIBCXX_3
.4
);
488 #ifdef _GLIBCXX_HAVE_SQRTL
489 _GLIBCXX_MATHL_WRAPPER1 (sqrt
, GLIBCXX_3
.4
);
491 #ifdef _GLIBCXX_HAVE_TANHL
492 _GLIBCXX_MATHL_WRAPPER1 (tanh
, GLIBCXX_3
.4
);
494 #ifdef _GLIBCXX_HAVE_TANL
495 _GLIBCXX_MATHL_WRAPPER1 (tan
, GLIBCXX_3
.4
);
497 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
501 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
502 extern void *_ZTVN10__cxxabiv123__fundamental_type_infoE
[];
503 extern void *_ZTVN10__cxxabiv119__pointer_type_infoE
[];
504 extern __attribute__((used
, weak
)) const char _ZTSe
[2] = "e";
505 extern __attribute__((used
, weak
)) const char _ZTSPe
[3] = "Pe";
506 extern __attribute__((used
, weak
)) const char _ZTSPKe
[4] = "PKe";
507 extern __attribute__((used
, weak
)) const void *_ZTIe
[2]
508 = { (void *) &_ZTVN10__cxxabiv123__fundamental_type_infoE
[2],
510 extern __attribute__((used
, weak
)) const void *_ZTIPe
[4]
511 = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE
[2],
512 (void *) _ZTSPe
, (void *) 0L, (void *) _ZTIe
};
513 extern __attribute__((used
, weak
)) const void *_ZTIPKe
[4]
514 = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE
[2],
515 (void *) _ZTSPKe
, (void *) 1L, (void *) _ZTIe
};
516 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
520 #ifdef _GLIBCXX_SYMVER_DARWIN
521 #if (defined(__ppc__) || defined(__ppc64__)) && defined(PIC)
522 /* __eprintf shouldn't have been made visible from libstdc++, or
523 anywhere, but on Mac OS X 10.4 it was defined in
524 libstdc++.6.0.3.dylib; so on that platform we have to keep defining
525 it to keep binary compatibility. We can't just put the libgcc
526 version in the export list, because that doesn't work; once a
527 symbol is marked as hidden, it stays that way. */
535 __eprintf(const char *string
, const char *expression
,
536 unsigned int line
, const char *filename
)
538 fprintf(stderr
, string
, expression
, line
, filename
);