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
55 _GLIBCXX_BEGIN_NAMESPACE(std)
57 // std::istream ignore explicit specializations.
61 ignore(streamsize __n)
67 sentry __cerb(*this, true);
68 if (__cerb && __n > 0)
70 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
73 const int_type __eof = traits_type::eof();
74 __streambuf_type* __sb = this->rdbuf();
75 int_type __c = __sb->sgetc();
77 // See comment in istream.tcc.
78 bool __large_ignore = false;
81 while (_M_gcount < __n
82 && !traits_type::eq_int_type(__c, __eof))
84 streamsize __size = std::min(streamsize(__sb->egptr()
86 streamsize(__n - _M_gcount));
99 if (__n == numeric_limits<streamsize>::max()
100 && !traits_type::eq_int_type(__c, __eof))
102 _M_gcount = numeric_limits<streamsize>::min();
103 __large_ignore = true;
110 _M_gcount = numeric_limits<streamsize>::max();
112 if (traits_type::eq_int_type(__c, __eof))
113 __err |= ios_base::eofbit;
116 { this->_M_setstate(ios_base::badbit); }
118 this->setstate(__err);
123 #ifdef _GLIBCXX_USE_WCHAR_T
125 basic_istream<wchar_t>&
126 basic_istream<wchar_t>::
127 ignore(streamsize __n)
133 sentry __cerb(*this, true);
134 if (__cerb && __n > 0)
136 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
139 const int_type __eof = traits_type::eof();
140 __streambuf_type* __sb = this->rdbuf();
141 int_type __c = __sb->sgetc();
143 bool __large_ignore = false;
146 while (_M_gcount < __n
147 && !traits_type::eq_int_type(__c, __eof))
149 streamsize __size = std::min(streamsize(__sb->egptr()
151 streamsize(__n - _M_gcount));
161 __c = __sb->snextc();
164 if (__n == numeric_limits<streamsize>::max()
165 && !traits_type::eq_int_type(__c, __eof))
167 _M_gcount = numeric_limits<streamsize>::min();
168 __large_ignore = true;
175 _M_gcount = numeric_limits<streamsize>::max();
177 if (traits_type::eq_int_type(__c, __eof))
178 __err |= ios_base::eofbit;
181 { this->_M_setstate(ios_base::badbit); }
183 this->setstate(__err);
189 _GLIBCXX_END_NAMESPACE
192 // NB: These symbols renames should go into the shared library only,
193 // and only those shared libraries that support versioning.
194 #if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC)
197 _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
198 _ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv
201 _GLIBCXX_BEGIN_NAMESPACE(std)
204 istreambuf_iterator<char>&
205 istreambuf_iterator<char>::operator++();
207 #ifdef _GLIBCXX_USE_WCHAR_T
209 istreambuf_iterator<wchar_t>&
210 istreambuf_iterator<wchar_t>::operator++();
213 _GLIBCXX_END_NAMESPACE
217 _ZNSs4_Rep26_M_set_length_and_sharableEj
221 _ZNKSs11_M_disjunctEPKc
222 _ZNKSs15_M_check_lengthEjjPKc
223 _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEj
224 _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwj
225 _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwj
226 _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw
227 _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw
228 _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEjjPKc
230 _ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv
231 _ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv
232 _ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv
233 _ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv
234 _ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv
235 _ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv
239 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEi
240 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv
242 _ZNSt11char_traitsIcE2eqERKcS2_
243 _ZNSt11char_traitsIwE2eqERKwS2_
245 _GLIBCXX_BEGIN_NAMESPACE(std)
247 // std::char_traits is explicitly specialized
248 bool (* __p1)(const char&, const char&) = &char_traits<char>::eq;
253 basic_string<char>::_M_copy(char*, const char*, size_t);
257 basic_string<char>::_M_move(char*, const char*, size_t);
261 basic_string<char>::_M_assign(char*, size_t, char);
265 basic_string<char>::_M_disjunct(const char*) const;
269 basic_string<char>::_M_check_length(size_t, size_t, const char*) const;
273 basic_string<char>::_Rep::_M_set_length_and_sharable(size_t);
279 basic_istream<char>::ignore();
283 basic_fstream<char>::is_open() const;
287 basic_ifstream<char>::is_open() const;
291 basic_ofstream<char>::is_open() const;
293 #ifdef _GLIBCXX_USE_WCHAR_T
294 bool (* __p2)(const wchar_t&, const wchar_t&) = &char_traits<wchar_t>::eq;
299 basic_string<wchar_t>::_M_copy(wchar_t*, const wchar_t*, size_t);
303 basic_string<wchar_t>::_M_move(wchar_t*, const wchar_t*, size_t);
307 basic_string<wchar_t>::_M_assign(wchar_t*, size_t, wchar_t);
311 basic_string<wchar_t>::_M_disjunct(const wchar_t*) const;
315 basic_string<wchar_t>::_M_check_length(size_t, size_t,
320 basic_string<wchar_t>::_Rep::_M_set_length_and_sharable(size_t);
323 basic_istream<wchar_t>&
324 basic_istream<wchar_t>::ignore();
328 basic_fstream<wchar_t>::is_open() const;
332 basic_ifstream<wchar_t>::is_open() const;
336 basic_ofstream<wchar_t>::is_open() const;
339 _GLIBCXX_END_NAMESPACE
341 // The rename syntax for default exported names is
342 // asm (".symver name1,exportedname@GLIBCXX_3.4")
343 // asm (".symver name2,exportedname@@GLIBCXX_3.4.5")
344 // In the future, GLIBCXX_ABI > 6 should remove all uses of
345 // _GLIBCXX_*_SYMVER macros in this file.
347 #define _GLIBCXX_3_4_SYMVER(XXname, name) \
350 __attribute__ ((alias(#XXname))); \
351 asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4");
353 #define _GLIBCXX_3_4_5_SYMVER(XXname, name) \
356 __attribute__ ((alias(#XXname))); \
357 asm (".symver " "_Y" #name "," #name "@@GLIBCXX_3.4.5");
359 #define _GLIBCXX_ASM_SYMVER(cur, old, version) \
360 asm (".symver " #cur "," #old "@@" #version);
362 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_SYMVER
363 #include <bits/compatibility.h>
364 #undef _GLIBCXX_APPLY_SYMVER
366 #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_5_SYMVER
367 #include <bits/compatibility.h>
368 #undef _GLIBCXX_APPLY_SYMVER
372 _ZN10__gnu_norm15_List_node_base4hookEPS0_;
373 _ZN10__gnu_norm15_List_node_base4swapERS0_S1_;
374 _ZN10__gnu_norm15_List_node_base6unhookEv;
375 _ZN10__gnu_norm15_List_node_base7reverseEv;
376 _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_;
379 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4hookEPS_, \
380 _ZN10__gnu_norm15_List_node_base4hookEPS0_, \
383 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4swapERS_S0_, \
384 _ZN10__gnu_norm15_List_node_base4swapERS0_S1_, \
387 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX6unhookEv, \
388 _ZN10__gnu_norm15_List_node_base6unhookEv, \
391 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX7reverseEv, \
392 _ZN10__gnu_norm15_List_node_base7reverseEv, \
395 _GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX8transferEPS_S0_, \
396 _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_, \
398 #undef _List_node_base
401 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
402 #define _GLIBCXX_MATHL_WRAPPER(name, argdecl, args, ver) \
404 __ ## name ## l_wrapper argdecl \
408 asm (".symver __" #name "l_wrapper, " #name "l@" #ver)
410 #define _GLIBCXX_MATHL_WRAPPER1(name, ver) \
411 _GLIBCXX_MATHL_WRAPPER (name, (double x), (x), ver)
413 #define _GLIBCXX_MATHL_WRAPPER2(name, ver) \
414 _GLIBCXX_MATHL_WRAPPER (name, (double x, double y), (x, y), ver)
416 #ifdef _GLIBCXX_HAVE_ACOSL
417 _GLIBCXX_MATHL_WRAPPER1 (acos, GLIBCXX_3.4.3);
419 #ifdef _GLIBCXX_HAVE_ASINL
420 _GLIBCXX_MATHL_WRAPPER1 (asin, GLIBCXX_3.4.3);
422 #ifdef _GLIBCXX_HAVE_ATAN2L
423 _GLIBCXX_MATHL_WRAPPER2 (atan2, GLIBCXX_3.4);
425 #ifdef _GLIBCXX_HAVE_ATANL
426 _GLIBCXX_MATHL_WRAPPER1 (atan, GLIBCXX_3.4.3);
428 #ifdef _GLIBCXX_HAVE_CEILL
429 _GLIBCXX_MATHL_WRAPPER1 (ceil, GLIBCXX_3.4.3);
431 #ifdef _GLIBCXX_HAVE_COSHL
432 _GLIBCXX_MATHL_WRAPPER1 (cosh, GLIBCXX_3.4);
434 #ifdef _GLIBCXX_HAVE_COSL
435 _GLIBCXX_MATHL_WRAPPER1 (cos, GLIBCXX_3.4);
437 #ifdef _GLIBCXX_HAVE_EXPL
438 _GLIBCXX_MATHL_WRAPPER1 (exp, GLIBCXX_3.4);
440 #ifdef _GLIBCXX_HAVE_FLOORL
441 _GLIBCXX_MATHL_WRAPPER1 (floor, GLIBCXX_3.4.3);
443 #ifdef _GLIBCXX_HAVE_FMODL
444 _GLIBCXX_MATHL_WRAPPER2 (fmod, GLIBCXX_3.4.3);
446 #ifdef _GLIBCXX_HAVE_FREXPL
447 _GLIBCXX_MATHL_WRAPPER (frexp, (double x, int *y), (x, y), GLIBCXX_3.4.3);
449 #ifdef _GLIBCXX_HAVE_HYPOTL
450 _GLIBCXX_MATHL_WRAPPER2 (hypot, GLIBCXX_3.4);
452 #ifdef _GLIBCXX_HAVE_LDEXPL
453 _GLIBCXX_MATHL_WRAPPER (ldexp, (double x, int y), (x, y), GLIBCXX_3.4.3);
455 #ifdef _GLIBCXX_HAVE_LOG10L
456 _GLIBCXX_MATHL_WRAPPER1 (log10, GLIBCXX_3.4);
458 #ifdef _GLIBCXX_HAVE_LOGL
459 _GLIBCXX_MATHL_WRAPPER1 (log, GLIBCXX_3.4);
461 #ifdef _GLIBCXX_HAVE_MODFL
462 _GLIBCXX_MATHL_WRAPPER (modf, (double x, double *y), (x, y), GLIBCXX_3.4.3);
464 #ifdef _GLIBCXX_HAVE_POWL
465 _GLIBCXX_MATHL_WRAPPER2 (pow, GLIBCXX_3.4);
467 #ifdef _GLIBCXX_HAVE_SINHL
468 _GLIBCXX_MATHL_WRAPPER1 (sinh, GLIBCXX_3.4);
470 #ifdef _GLIBCXX_HAVE_SINL
471 _GLIBCXX_MATHL_WRAPPER1 (sin, GLIBCXX_3.4);
473 #ifdef _GLIBCXX_HAVE_SQRTL
474 _GLIBCXX_MATHL_WRAPPER1 (sqrt, GLIBCXX_3.4);
476 #ifdef _GLIBCXX_HAVE_TANHL
477 _GLIBCXX_MATHL_WRAPPER1 (tanh, GLIBCXX_3.4);
479 #ifdef _GLIBCXX_HAVE_TANL
480 _GLIBCXX_MATHL_WRAPPER1 (tan, GLIBCXX_3.4);
482 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
486 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
487 extern void *_ZTVN10__cxxabiv123__fundamental_type_infoE[];
488 extern void *_ZTVN10__cxxabiv119__pointer_type_infoE[];
489 extern __attribute__((used, weak)) const char _ZTSe[2] = "e";
490 extern __attribute__((used, weak)) const char _ZTSPe[3] = "Pe";
491 extern __attribute__((used, weak)) const char _ZTSPKe[4] = "PKe";
492 extern __attribute__((used, weak)) const void *_ZTIe[2]
493 = { (void *) &_ZTVN10__cxxabiv123__fundamental_type_infoE[2],
495 extern __attribute__((used, weak)) const void *_ZTIPe[4]
496 = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE[2],
497 (void *) _ZTSPe, (void *) 0L, (void *) _ZTIe };
498 extern __attribute__((used, weak)) const void *_ZTIPKe[4]
499 = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE[2],
500 (void *) _ZTSPKe, (void *) 1L, (void *) _ZTIe };
501 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
505 #ifdef _GLIBCXX_SYMVER_DARWIN
506 #if (defined(__ppc__) || defined(__ppc64__)) && defined(PIC)
507 /* __eprintf shouldn't have been made visible from libstdc++, or
508 anywhere, but on Mac OS X 10.4 it was defined in
509 libstdc++.6.0.3.dylib; so on that platform we have to keep defining
510 it to keep binary compatibility. We can't just put the libgcc
511 version in the export list, because that doesn't work; once a
512 symbol is marked as hidden, it stays that way. */
520 __eprintf(const char *string, const char *expression,
521 unsigned int line, const char *filename)
523 fprintf(stderr, string, expression, line, filename);