1 // Compatibility symbols for previous versions -*- C++ -*-
3 // Copyright (C) 2005, 2006
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 #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
46 #define _List_node_base _List_node_baseXX
54 #include <ext/numeric_traits.h>
56 _GLIBCXX_BEGIN_NAMESPACE(std
)
58 // std::istream ignore explicit specializations.
62 ignore(streamsize __n
)
68 sentry
__cerb(*this, true);
69 if (__cerb
&& __n
> 0)
71 ios_base::iostate __err
= ios_base::iostate(ios_base::goodbit
);
74 const int_type __eof
= traits_type::eof();
75 __streambuf_type
* __sb
= this->rdbuf();
76 int_type __c
= __sb
->sgetc();
78 // See comment in istream.tcc.
79 bool __large_ignore
= false;
82 while (_M_gcount
< __n
83 && !traits_type::eq_int_type(__c
, __eof
))
85 streamsize __size
= std::min(streamsize(__sb
->egptr()
87 streamsize(__n
- _M_gcount
));
100 if (__n
== __gnu_cxx::__numeric_traits
<streamsize
>::__max
101 && !traits_type::eq_int_type(__c
, __eof
))
104 __gnu_cxx::__numeric_traits
<streamsize
>::__min
;
105 __large_ignore
= true;
112 _M_gcount
= __gnu_cxx::__numeric_traits
<streamsize
>::__max
;
114 if (traits_type::eq_int_type(__c
, __eof
))
115 __err
|= ios_base::eofbit
;
117 catch(__cxxabiv1::__forced_unwind
&)
119 this->_M_setstate(ios_base::badbit
);
120 __throw_exception_again
;
123 { this->_M_setstate(ios_base::badbit
); }
125 this->setstate(__err
);
130 #ifdef _GLIBCXX_USE_WCHAR_T
132 basic_istream
<wchar_t>&
133 basic_istream
<wchar_t>::
134 ignore(streamsize __n
)
140 sentry
__cerb(*this, true);
141 if (__cerb
&& __n
> 0)
143 ios_base::iostate __err
= ios_base::iostate(ios_base::goodbit
);
146 const int_type __eof
= traits_type::eof();
147 __streambuf_type
* __sb
= this->rdbuf();
148 int_type __c
= __sb
->sgetc();
150 bool __large_ignore
= false;
153 while (_M_gcount
< __n
154 && !traits_type::eq_int_type(__c
, __eof
))
156 streamsize __size
= std::min(streamsize(__sb
->egptr()
158 streamsize(__n
- _M_gcount
));
168 __c
= __sb
->snextc();
171 if (__n
== __gnu_cxx::__numeric_traits
<streamsize
>::__max
172 && !traits_type::eq_int_type(__c
, __eof
))
175 __gnu_cxx::__numeric_traits
<streamsize
>::__min
;
176 __large_ignore
= true;
183 _M_gcount
= __gnu_cxx::__numeric_traits
<streamsize
>::__max
;
185 if (traits_type::eq_int_type(__c
, __eof
))
186 __err
|= ios_base::eofbit
;
188 catch(__cxxabiv1::__forced_unwind
&)
190 this->_M_setstate(ios_base::badbit
);
191 __throw_exception_again
;
194 { this->_M_setstate(ios_base::badbit
); }
196 this->setstate(__err
);
202 _GLIBCXX_END_NAMESPACE
205 // NB: These symbols renames should go into the shared library only,
206 // and only those shared libraries that support versioning.
207 #if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC)
210 _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
211 _ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv
214 _GLIBCXX_BEGIN_NAMESPACE(std
)
217 istreambuf_iterator
<char>&
218 istreambuf_iterator
<char>::operator++();
220 #ifdef _GLIBCXX_USE_WCHAR_T
222 istreambuf_iterator
<wchar_t>&
223 istreambuf_iterator
<wchar_t>::operator++();
226 _GLIBCXX_END_NAMESPACE
230 _ZNSs4_Rep26_M_set_length_and_sharableEj
234 _ZNKSs11_M_disjunctEPKc
235 _ZNKSs15_M_check_lengthEjjPKc
236 _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEj
237 _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwj
238 _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwj
239 _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw
240 _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw
241 _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEjjPKc
243 _ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv
244 _ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv
245 _ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv
246 _ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv
247 _ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv
248 _ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv
252 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEi
253 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv
255 _ZNSt11char_traitsIcE2eqERKcS2_
256 _ZNSt11char_traitsIwE2eqERKwS2_
258 _GLIBCXX_BEGIN_NAMESPACE(std
)
260 // std::char_traits is explicitly specialized
261 bool (* __p1
)(const char&, const char&) = &char_traits
<char>::eq
;
266 basic_string
<char>::_M_copy(char*, const char*, size_t);
270 basic_string
<char>::_M_move(char*, const char*, size_t);
274 basic_string
<char>::_M_assign(char*, size_t, char);
278 basic_string
<char>::_M_disjunct(const char*) const;
282 basic_string
<char>::_M_check_length(size_t, size_t, const char*) const;
286 basic_string
<char>::_Rep::_M_set_length_and_sharable(size_t);
292 basic_istream
<char>::ignore();
296 basic_fstream
<char>::is_open() const;
300 basic_ifstream
<char>::is_open() const;
304 basic_ofstream
<char>::is_open() const;
306 #ifdef _GLIBCXX_USE_WCHAR_T
307 bool (* __p2
)(const wchar_t&, const wchar_t&) = &char_traits
<wchar_t>::eq
;
312 basic_string
<wchar_t>::_M_copy(wchar_t*, const wchar_t*, size_t);
316 basic_string
<wchar_t>::_M_move(wchar_t*, const wchar_t*, size_t);
320 basic_string
<wchar_t>::_M_assign(wchar_t*, size_t, wchar_t);
324 basic_string
<wchar_t>::_M_disjunct(const wchar_t*) const;
328 basic_string
<wchar_t>::_M_check_length(size_t, size_t,
333 basic_string
<wchar_t>::_Rep::_M_set_length_and_sharable(size_t);
336 basic_istream
<wchar_t>&
337 basic_istream
<wchar_t>::ignore();
341 basic_fstream
<wchar_t>::is_open() const;
345 basic_ifstream
<wchar_t>::is_open() const;
349 basic_ofstream
<wchar_t>::is_open() const;
352 _GLIBCXX_END_NAMESPACE
354 // The rename syntax for default exported names is
355 // asm (".symver name1,exportedname@GLIBCXX_3.4")
356 // asm (".symver name2,exportedname@@GLIBCXX_3.4.5")
357 // In the future, GLIBCXX_ABI > 6 should remove all uses of
358 // _GLIBCXX_*_SYMVER macros in this file.
360 #define _GLIBCXX_3_4_SYMVER(XXname, name) \
363 __attribute__ ((alias(#XXname))); \
364 asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4");
366 #define _GLIBCXX_3_4_5_SYMVER(XXname, name) \
369 __attribute__ ((alias(#XXname))); \
370 asm (".symver " "_Y" #name "," #name "@@GLIBCXX_3.4.5");
372 #define _GLIBCXX_ASM_SYMVER(cur, old, version) \
373 asm (".symver " #cur "," #old "@@" #version);
375 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_SYMVER
376 #include <bits/compatibility.h>
377 #undef _GLIBCXX_APPLY_SYMVER
379 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_5_SYMVER
380 #include <bits/compatibility.h>
381 #undef _GLIBCXX_APPLY_SYMVER
385 _ZN10__gnu_norm15_List_node_base4hookEPS0_;
386 _ZN10__gnu_norm15_List_node_base4swapERS0_S1_;
387 _ZN10__gnu_norm15_List_node_base6unhookEv;
388 _ZN10__gnu_norm15_List_node_base7reverseEv;
389 _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_;
392 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4hookEPS_
, \
393 _ZN10__gnu_norm15_List_node_base4hookEPS0_
, \
396 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4swapERS_S0_
, \
397 _ZN10__gnu_norm15_List_node_base4swapERS0_S1_
, \
400 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX6unhookEv
, \
401 _ZN10__gnu_norm15_List_node_base6unhookEv
, \
404 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX7reverseEv
, \
405 _ZN10__gnu_norm15_List_node_base7reverseEv
, \
408 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX8transferEPS_S0_
, \
409 _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_
, \
411 #undef _List_node_base
414 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
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
);