From: Paolo Carlini Date: Thu, 31 Mar 2011 16:06:12 +0000 (+0000) Subject: re PR libstdc++/48382 (ctype_noninline.h should not be installed) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=246428c2d410e0c196bb48f038128bd4cb082c43;p=gcc.git re PR libstdc++/48382 (ctype_noninline.h should not be installed) 2011-03-31 Paolo Carlini PR libstdc++/48382 * src/ctype.cc: Do not include . * src/Makefile.am: Add ctype_configure_char.cc to host_sources. * src/Makefile.in: Regenerate. * include/Makefile.am: Remove ctype_noninline.h from host_headers. * include/Makefile.in: Regenerate. * doc/xml/manual/internals.xml: Update. * config/os/newlib/ctype_noninline.h: Fixup and rename to... * config/os/newlib/ctype_configure_char.cc: ... this. * config/os/aix/ctype_noninline.h: Likewise. * config/os/aix/ctype_configure_char.cc: Likewise. * config/os/vxworks/ctype_noninline.h: Likewise. * config/os/vxworks/ctype_configure_char.cc * config/os/hpux/ctype_noninline.h: Likewise. * config/os/hpux/ctype_configure_char.cc: Likewise. * config/os/gnu-linux/ctype_noninline.h: Likewise. * config/os/gnu-linux/ctype_configure_char.cc: Likewise. * config/os/mingw32/ctype_noninline.h: Likewise. * config/os/mingw32/ctype_configure_char.cc: Likewise. * config/os/tpf/ctype_noninline.h: Likewise. * config/os/tpf/ctype_configure_char.cc: Likewise. * config/os/uclibc/ctype_noninline.h: Likewise. * config/os/uclibc/ctype_configure_char.cc: Likewise. * config/os/bionic/ctype_noninline.h: Likewise. * config/os/bionic/ctype_configure_char.cc: Likewise. * config/os/djgpp/ctype_noninline.h: Likewise. * config/os/djgpp/ctype_configure_char.cc: Likewise. * config/os/qnx/qnx6.1/ctype_noninline.h: Likewise. * config/os/qnx/qnx6.1/ctype_configure_char.cc: Likewise. * config/os/bsd/netbsd/ctype_noninline.h: Likewise. * config/os/bsd/netbsd/ctype_configure_char.cc: Likewise. * config/os/bsd/darwin/ctype_noninline.h: Likewise. * config/os/bsd/darwin/ctype_configure_char.cc: Likewise. * config/os/bsd/freebsd/ctype_noninline.h: Likewise. * config/os/bsd/freebsd/ctype_configure_char.cc: Likewise. * config/os/irix/irix6.5/ctype_noninline.h: Likewise. * config/os/irix/irix6.5/ctype_configure_char.cc: Likewise. * config/os/generic/ctype_noninline.h: Likewise. * config/os/generic/ctype_configure_char.cc: Likewise. * config/os/solaris/solaris2.7/ctype_noninline.h: Likewise. * config/os/solaris/solaris2.7/ctype_configure_char.cc: Likewise. From-SVN: r171790 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e7cfb3240f7..26834e5f928 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,47 @@ +2011-03-31 Paolo Carlini + + PR libstdc++/48382 + * src/ctype.cc: Do not include . + * src/Makefile.am: Add ctype_configure_char.cc to host_sources. + * src/Makefile.in: Regenerate. + * include/Makefile.am: Remove ctype_noninline.h from host_headers. + * include/Makefile.in: Regenerate. + * doc/xml/manual/internals.xml: Update. + * config/os/newlib/ctype_noninline.h: Fixup and rename to... + * config/os/newlib/ctype_configure_char.cc: ... this. + * config/os/aix/ctype_noninline.h: Likewise. + * config/os/aix/ctype_configure_char.cc: Likewise. + * config/os/vxworks/ctype_noninline.h: Likewise. + * config/os/vxworks/ctype_configure_char.cc + * config/os/hpux/ctype_noninline.h: Likewise. + * config/os/hpux/ctype_configure_char.cc: Likewise. + * config/os/gnu-linux/ctype_noninline.h: Likewise. + * config/os/gnu-linux/ctype_configure_char.cc: Likewise. + * config/os/mingw32/ctype_noninline.h: Likewise. + * config/os/mingw32/ctype_configure_char.cc: Likewise. + * config/os/tpf/ctype_noninline.h: Likewise. + * config/os/tpf/ctype_configure_char.cc: Likewise. + * config/os/uclibc/ctype_noninline.h: Likewise. + * config/os/uclibc/ctype_configure_char.cc: Likewise. + * config/os/bionic/ctype_noninline.h: Likewise. + * config/os/bionic/ctype_configure_char.cc: Likewise. + * config/os/djgpp/ctype_noninline.h: Likewise. + * config/os/djgpp/ctype_configure_char.cc: Likewise. + * config/os/qnx/qnx6.1/ctype_noninline.h: Likewise. + * config/os/qnx/qnx6.1/ctype_configure_char.cc: Likewise. + * config/os/bsd/netbsd/ctype_noninline.h: Likewise. + * config/os/bsd/netbsd/ctype_configure_char.cc: Likewise. + * config/os/bsd/darwin/ctype_noninline.h: Likewise. + * config/os/bsd/darwin/ctype_configure_char.cc: Likewise. + * config/os/bsd/freebsd/ctype_noninline.h: Likewise. + * config/os/bsd/freebsd/ctype_configure_char.cc: Likewise. + * config/os/irix/irix6.5/ctype_noninline.h: Likewise. + * config/os/irix/irix6.5/ctype_configure_char.cc: Likewise. + * config/os/generic/ctype_noninline.h: Likewise. + * config/os/generic/ctype_configure_char.cc: Likewise. + * config/os/solaris/solaris2.7/ctype_noninline.h: Likewise. + * config/os/solaris/solaris2.7/ctype_configure_char.cc: Likewise. + 2011-03-25 Jonathan Wakely * testsuite/28_regex/match_results/ctors/char/default.cc: Do not call diff --git a/libstdc++-v3/config/os/aix/ctype_configure_char.cc b/libstdc++-v3/config/os/aix/ctype_configure_char.cc new file mode 100644 index 00000000000..d6ca6b5fbcd --- /dev/null +++ b/libstdc++-v3/config/os/aix/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return 0; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/aix/ctype_noninline.h b/libstdc++-v3/config/os/aix/ctype_noninline.h deleted file mode 100644 index 71024bdcb5e..00000000000 --- a/libstdc++-v3/config/os/aix/ctype_noninline.h +++ /dev/null @@ -1,91 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002, 2009, 2010 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return 0; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return ::toupper((int) __c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::toupper((int) *__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return ::tolower((int) __c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::tolower((int) *__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/bionic/ctype_configure_char.cc b/libstdc++-v3/config/os/bionic/ctype_configure_char.cc new file mode 100644 index 00000000000..d5a8fe16314 --- /dev/null +++ b/libstdc++-v3/config/os/bionic/ctype_configure_char.cc @@ -0,0 +1,105 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return _ctype_ + 1; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { + int __x = __c; + return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x); + } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_toupper(*__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { + int __x = __c; + return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x); + } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_tolower(*__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/bionic/ctype_noninline.h b/libstdc++-v3/config/os/bionic/ctype_noninline.h deleted file mode 100644 index 78bc2960800..00000000000 --- a/libstdc++-v3/config/os/bionic/ctype_noninline.h +++ /dev/null @@ -1,98 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2010 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return _ctype_ + 1; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { - int __x = __c; - return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x); - } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = this->do_toupper(*__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { - int __x = __c; - return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x); - } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = this->do_tolower(*__low); - ++__low; - } - return __high; - } - diff --git a/libstdc++-v3/config/os/bsd/darwin/ctype_configure_char.cc b/libstdc++-v3/config/os/bsd/darwin/ctype_configure_char.cc new file mode 100644 index 00000000000..30cf4ad6a02 --- /dev/null +++ b/libstdc++-v3/config/os/bsd/darwin/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return 0; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/bsd/darwin/ctype_noninline.h b/libstdc++-v3/config/os/bsd/darwin/ctype_noninline.h deleted file mode 100644 index e8e22f62836..00000000000 --- a/libstdc++-v3/config/os/bsd/darwin/ctype_noninline.h +++ /dev/null @@ -1,92 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return 0; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return ::toupper((int) __c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::toupper((int) *__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return ::tolower((int) __c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::tolower((int) *__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/bsd/freebsd/ctype_configure_char.cc b/libstdc++-v3/config/os/bsd/freebsd/ctype_configure_char.cc new file mode 100644 index 00000000000..30cf4ad6a02 --- /dev/null +++ b/libstdc++-v3/config/os/bsd/freebsd/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return 0; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h b/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h deleted file mode 100644 index e8e22f62836..00000000000 --- a/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h +++ /dev/null @@ -1,92 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return 0; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return ::toupper((int) __c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::toupper((int) *__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return ::tolower((int) __c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::tolower((int) *__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc b/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc new file mode 100644 index 00000000000..77fe6275693 --- /dev/null +++ b/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc @@ -0,0 +1,101 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + extern "C" const u_int8_t _C_ctype_[]; + + const ctype_base::mask* + ctype::classic_table() throw() + { return _C_ctype_ + 1; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h b/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h deleted file mode 100644 index 724523f5a8a..00000000000 --- a/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h +++ /dev/null @@ -1,94 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002, 2003, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - extern "C" const u_int8_t _C_ctype_[]; - - const ctype_base::mask* - ctype::classic_table() throw() - { return _C_ctype_ + 1; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return ::toupper((int) __c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::toupper((int) *__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return ::tolower((int) __c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::tolower((int) *__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc b/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc new file mode 100644 index 00000000000..f755eb70c4e --- /dev/null +++ b/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from DJGPP + + const ctype_base::mask* + ctype::classic_table() throw() + { return __dj_ctype_flags+1; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[static_cast(__c)]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[static_cast(*__low)]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[static_cast(__c)]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[static_cast(*__low)]; + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/djgpp/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/ctype_noninline.h deleted file mode 100644 index 7b14d38b63d..00000000000 --- a/libstdc++-v3/config/os/djgpp/ctype_noninline.h +++ /dev/null @@ -1,92 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from DJGPP - - const ctype_base::mask* - ctype::classic_table() throw() - { return __dj_ctype_flags+1; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return _M_toupper[static_cast(__c)]; } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_toupper[static_cast(*__low)]; - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return _M_tolower[static_cast(__c)]; } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_tolower[static_cast(*__low)]; - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/generic/ctype_configure_char.cc b/libstdc++-v3/config/os/generic/ctype_configure_char.cc new file mode 100644 index 00000000000..0daedf54356 --- /dev/null +++ b/libstdc++-v3/config/os/generic/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return 0; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/generic/ctype_noninline.h b/libstdc++-v3/config/os/generic/ctype_noninline.h deleted file mode 100644 index 30045899f76..00000000000 --- a/libstdc++-v3/config/os/generic/ctype_noninline.h +++ /dev/null @@ -1,92 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return 0; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return ::toupper((int) __c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::toupper((int) *__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return ::tolower((int) __c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::tolower((int) *__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_configure_char.cc b/libstdc++-v3/config/os/gnu-linux/ctype_configure_char.cc new file mode 100644 index 00000000000..5eadeaaace6 --- /dev/null +++ b/libstdc++-v3/config/os/gnu-linux/ctype_configure_char.cc @@ -0,0 +1,196 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + +#if _GLIBCXX_C_LOCALE_GNU + const ctype_base::mask* + ctype::classic_table() throw() + { return _S_get_c_locale()->__ctype_b; } +#else + const ctype_base::mask* + ctype::classic_table() throw() + { + const ctype_base::mask* __ret; + char* __old = setlocale(LC_CTYPE, NULL); + char* __sav = NULL; + if (__builtin_strcmp(__old, "C")) + { + const size_t __len = __builtin_strlen(__old) + 1; + __sav = new char[__len]; + __builtin_memcpy(__sav, __old, __len); + setlocale(LC_CTYPE, "C"); + } +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) + __ret = *__ctype_b_loc(); +#else + __ret = __ctype_b; +#endif + if (__sav) + { + setlocale(LC_CTYPE, __sav); + delete [] __sav; + } + return __ret; + } +#endif + +#if _GLIBCXX_C_LOCALE_GNU + ctype::ctype(__c_locale __cloc, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_c_locale_ctype(_S_clone_c_locale(__cloc)), + _M_del(__table != 0 && __del), + _M_toupper(_M_c_locale_ctype->__ctype_toupper), + _M_tolower(_M_c_locale_ctype->__ctype_tolower), + _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b), + _M_widen_ok(0), _M_narrow_ok(0) + { + __builtin_memset(_M_widen, 0, sizeof(_M_widen)); + __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); + } +#else + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) + { + char* __old = setlocale(LC_CTYPE, NULL); + char* __sav = NULL; + if (__builtin_strcmp(__old, "C")) + { + const size_t __len = __builtin_strlen(__old) + 1; + __sav = new char[__len]; + __builtin_memcpy(__sav, __old, __len); + setlocale(LC_CTYPE, "C"); + } +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) + _M_toupper = *__ctype_toupper_loc(); + _M_tolower = *__ctype_tolower_loc(); + _M_table = __table ? __table : *__ctype_b_loc(); +#else + _M_toupper = __ctype_toupper; + _M_tolower = __ctype_tolower; + _M_table = __table ? __table : __ctype_b; +#endif + if (__sav) + { + setlocale(LC_CTYPE, __sav); + delete [] __sav; + } + __builtin_memset(_M_widen, 0, sizeof(_M_widen)); + __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); + } +#endif + +#if _GLIBCXX_C_LOCALE_GNU + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), + _M_del(__table != 0 && __del), + _M_toupper(_M_c_locale_ctype->__ctype_toupper), + _M_tolower(_M_c_locale_ctype->__ctype_tolower), + _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b), + _M_widen_ok(0), _M_narrow_ok(0) + { + __builtin_memset(_M_widen, 0, sizeof(_M_widen)); + __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); + } +#else + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) + { + char* __old = setlocale(LC_CTYPE, NULL); + char* __sav = NULL; + if (__builtin_strcmp(__old, "C")) + { + const size_t __len = __builtin_strlen(__old) + 1; + __sav = new char[__len]; + __builtin_memcpy(__sav, __old, __len); + setlocale(LC_CTYPE, "C"); + } +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) + _M_toupper = *__ctype_toupper_loc(); + _M_tolower = *__ctype_tolower_loc(); + _M_table = __table ? __table : *__ctype_b_loc(); +#else + _M_toupper = __ctype_toupper; + _M_tolower = __ctype_tolower; + _M_table = __table ? __table : __ctype_b; +#endif + if (__sav) + { + setlocale(LC_CTYPE, __sav); + delete [] __sav; + } + __builtin_memset(_M_widen, 0, sizeof(_M_widen)); + __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); + } +#endif + + char + ctype::do_toupper(char __c) const + { return _M_toupper[static_cast(__c)]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[static_cast(*__low)]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[static_cast(__c)]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[static_cast(*__low)]; + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h b/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h deleted file mode 100644 index 45785d4a5e8..00000000000 --- a/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h +++ /dev/null @@ -1,190 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - -#if _GLIBCXX_C_LOCALE_GNU - const ctype_base::mask* - ctype::classic_table() throw() - { return _S_get_c_locale()->__ctype_b; } -#else - const ctype_base::mask* - ctype::classic_table() throw() - { - const ctype_base::mask* __ret; - char* __old = setlocale(LC_CTYPE, NULL); - char* __sav = NULL; - if (__builtin_strcmp(__old, "C")) - { - const size_t __len = __builtin_strlen(__old) + 1; - __sav = new char[__len]; - __builtin_memcpy(__sav, __old, __len); - setlocale(LC_CTYPE, "C"); - } -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) - __ret = *__ctype_b_loc(); -#else - __ret = __ctype_b; -#endif - if (__sav) - { - setlocale(LC_CTYPE, __sav); - delete [] __sav; - } - return __ret; - } -#endif - -#if _GLIBCXX_C_LOCALE_GNU - ctype::ctype(__c_locale __cloc, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_c_locale_ctype(_S_clone_c_locale(__cloc)), - _M_del(__table != 0 && __del), - _M_toupper(_M_c_locale_ctype->__ctype_toupper), - _M_tolower(_M_c_locale_ctype->__ctype_tolower), - _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b), - _M_widen_ok(0), _M_narrow_ok(0) - { - __builtin_memset(_M_widen, 0, sizeof(_M_widen)); - __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); - } -#else - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), - _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) - { - char* __old = setlocale(LC_CTYPE, NULL); - char* __sav = NULL; - if (__builtin_strcmp(__old, "C")) - { - const size_t __len = __builtin_strlen(__old) + 1; - __sav = new char[__len]; - __builtin_memcpy(__sav, __old, __len); - setlocale(LC_CTYPE, "C"); - } -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) - _M_toupper = *__ctype_toupper_loc(); - _M_tolower = *__ctype_tolower_loc(); - _M_table = __table ? __table : *__ctype_b_loc(); -#else - _M_toupper = __ctype_toupper; - _M_tolower = __ctype_tolower; - _M_table = __table ? __table : __ctype_b; -#endif - if (__sav) - { - setlocale(LC_CTYPE, __sav); - delete [] __sav; - } - __builtin_memset(_M_widen, 0, sizeof(_M_widen)); - __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); - } -#endif - -#if _GLIBCXX_C_LOCALE_GNU - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), - _M_del(__table != 0 && __del), - _M_toupper(_M_c_locale_ctype->__ctype_toupper), - _M_tolower(_M_c_locale_ctype->__ctype_tolower), - _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b), - _M_widen_ok(0), _M_narrow_ok(0) - { - __builtin_memset(_M_widen, 0, sizeof(_M_widen)); - __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); - } -#else - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), - _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) - { - char* __old = setlocale(LC_CTYPE, NULL); - char* __sav = NULL; - if (__builtin_strcmp(__old, "C")) - { - const size_t __len = __builtin_strlen(__old) + 1; - __sav = new char[__len]; - __builtin_memcpy(__sav, __old, __len); - setlocale(LC_CTYPE, "C"); - } -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) - _M_toupper = *__ctype_toupper_loc(); - _M_tolower = *__ctype_tolower_loc(); - _M_table = __table ? __table : *__ctype_b_loc(); -#else - _M_toupper = __ctype_toupper; - _M_tolower = __ctype_tolower; - _M_table = __table ? __table : __ctype_b; -#endif - if (__sav) - { - setlocale(LC_CTYPE, __sav); - delete [] __sav; - } - __builtin_memset(_M_widen, 0, sizeof(_M_widen)); - __builtin_memset(_M_narrow, 0, sizeof(_M_narrow)); - } -#endif - - char - ctype::do_toupper(char __c) const - { return _M_toupper[static_cast(__c)]; } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_toupper[static_cast(*__low)]; - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return _M_tolower[static_cast(__c)]; } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_tolower[static_cast(*__low)]; - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/hpux/ctype_configure_char.cc b/libstdc++-v3/config/os/hpux/ctype_configure_char.cc new file mode 100644 index 00000000000..4ac958a2797 --- /dev/null +++ b/libstdc++-v3/config/os/hpux/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return __SB_masks; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : (const mask *) __SB_masks) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : (const mask *) __SB_masks) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/hpux/ctype_noninline.h b/libstdc++-v3/config/os/hpux/ctype_noninline.h deleted file mode 100644 index 9d178443e29..00000000000 --- a/libstdc++-v3/config/os/hpux/ctype_noninline.h +++ /dev/null @@ -1,92 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return __SB_masks; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : (const mask *) __SB_masks) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : (const mask *) __SB_masks) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return ::toupper((int) __c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::toupper((int) *__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return ::tolower((int) __c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::tolower((int) *__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc b/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc new file mode 100644 index 00000000000..aa2481bce02 --- /dev/null +++ b/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc @@ -0,0 +1,101 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return 0; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(!__table ? + (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(!__table ? + (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return _toupper(__c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = do_toupper(*__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _tolower(__c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = do_tolower(*__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h deleted file mode 100644 index 3f7af67e860..00000000000 --- a/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h +++ /dev/null @@ -1,94 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return 0; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(!__table ? - (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(!__table ? - (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return _toupper(__c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = do_toupper(*__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return _tolower(__c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = do_tolower(*__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/mingw32/ctype_configure_char.cc b/libstdc++-v3/config/os/mingw32/ctype_configure_char.cc new file mode 100644 index 00000000000..12184075d77 --- /dev/null +++ b/libstdc++-v3/config/os/mingw32/ctype_configure_char.cc @@ -0,0 +1,243 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // The classic table used in libstdc++ is *not* the C _ctype table + // used by mscvrt, but is based on the ctype masks defined for libstdc++ + // in ctype_base.h. + + const ctype_base::mask* + ctype::classic_table() throw() + { + static const ctype_base::mask _S_classic_table[256] = + { + cntrl /* null */, + cntrl /* ^A */, + cntrl /* ^B */, + cntrl /* ^C */, + cntrl /* ^D */, + cntrl /* ^E */, + cntrl /* ^F */, + cntrl /* ^G */, + cntrl /* ^H */, + ctype_base::mask(space | cntrl) /* tab */, + ctype_base::mask(space | cntrl) /* LF */, + ctype_base::mask(space | cntrl) /* ^K */, + ctype_base::mask(space | cntrl) /* FF */, + ctype_base::mask(space | cntrl) /* ^M */, + cntrl /* ^N */, + cntrl /* ^O */, + cntrl /* ^P */, + cntrl /* ^Q */, + cntrl /* ^R */, + cntrl /* ^S */, + cntrl /* ^T */, + cntrl /* ^U */, + cntrl /* ^V */, + cntrl /* ^W */, + cntrl /* ^X */, + cntrl /* ^Y */, + cntrl /* ^Z */, + cntrl /* esc */, + cntrl /* ^\ */, + cntrl /* ^] */, + cntrl /* ^^ */, + cntrl /* ^_ */, + ctype_base::mask(space | print) /* */, + ctype_base::mask(punct | print) /* ! */, + ctype_base::mask(punct | print) /* " */, + ctype_base::mask(punct | print) /* # */, + ctype_base::mask(punct | print) /* $ */, + ctype_base::mask(punct | print) /* % */, + ctype_base::mask(punct | print) /* & */, + ctype_base::mask(punct | print) /* ' */, + ctype_base::mask(punct | print) /* ( */, + ctype_base::mask(punct | print) /* ) */, + ctype_base::mask(punct | print) /* * */, + ctype_base::mask(punct | print) /* + */, + ctype_base::mask(punct | print) /* , */, + ctype_base::mask(punct | print) /* - */, + ctype_base::mask(punct | print) /* . */, + ctype_base::mask(punct | print) /* / */, + ctype_base::mask(digit | xdigit | print) /* 0 */, + ctype_base::mask(digit | xdigit | print) /* 1 */, + ctype_base::mask(digit | xdigit | print) /* 2 */, + ctype_base::mask(digit | xdigit | print) /* 3 */, + ctype_base::mask(digit | xdigit | print) /* 4 */, + ctype_base::mask(digit | xdigit | print) /* 5 */, + ctype_base::mask(digit | xdigit | print) /* 6 */, + ctype_base::mask(digit | xdigit | print) /* 7 */, + ctype_base::mask(digit | xdigit | print) /* 8 */, + ctype_base::mask(digit | xdigit | print) /* 9 */, + ctype_base::mask(punct | print) /* : */, + ctype_base::mask(punct | print) /* ; */, + ctype_base::mask(punct | print) /* < */, + ctype_base::mask(punct | print) /* = */, + ctype_base::mask(punct | print) /* > */, + ctype_base::mask(punct | print) /* ? */, + ctype_base::mask(punct | print) /* ! */, + ctype_base::mask(alpha | upper | xdigit | print) /* A */, + ctype_base::mask(alpha | upper | xdigit | print) /* B */, + ctype_base::mask(alpha | upper | xdigit | print) /* C */, + ctype_base::mask(alpha | upper | xdigit | print) /* D */, + ctype_base::mask(alpha | upper | xdigit | print) /* E */, + ctype_base::mask(alpha | upper | xdigit | print) /* F */, + ctype_base::mask(alpha | upper | print) /* G */, + ctype_base::mask(alpha | upper | print) /* H */, + ctype_base::mask(alpha | upper | print) /* I */, + ctype_base::mask(alpha | upper | print) /* J */, + ctype_base::mask(alpha | upper | print) /* K */, + ctype_base::mask(alpha | upper | print) /* L */, + ctype_base::mask(alpha | upper | print) /* M */, + ctype_base::mask(alpha | upper | print) /* N */, + ctype_base::mask(alpha | upper | print) /* O */, + ctype_base::mask(alpha | upper | print) /* P */, + ctype_base::mask(alpha | upper | print) /* Q */, + ctype_base::mask(alpha | upper | print) /* R */, + ctype_base::mask(alpha | upper | print) /* S */, + ctype_base::mask(alpha | upper | print) /* T */, + ctype_base::mask(alpha | upper | print) /* U */, + ctype_base::mask(alpha | upper | print) /* V */, + ctype_base::mask(alpha | upper | print) /* W */, + ctype_base::mask(alpha | upper | print) /* X */, + ctype_base::mask(alpha | upper | print) /* Y */, + ctype_base::mask(alpha | upper | print) /* Z */, + ctype_base::mask(punct | print) /* [ */, + ctype_base::mask(punct | print) /* \ */, + ctype_base::mask(punct | print) /* ] */, + ctype_base::mask(punct | print) /* ^ */, + ctype_base::mask(punct | print) /* _ */, + ctype_base::mask(punct | print) /* ` */, + ctype_base::mask(alpha | lower | xdigit | print) /* a */, + ctype_base::mask(alpha | lower | xdigit | print) /* b */, + ctype_base::mask(alpha | lower | xdigit | print) /* c */, + ctype_base::mask(alpha | lower | xdigit | print) /* d */, + ctype_base::mask(alpha | lower | xdigit | print) /* e */, + ctype_base::mask(alpha | lower | xdigit | print) /* f */, + ctype_base::mask(alpha | lower | print) /* g */, + ctype_base::mask(alpha | lower | print) /* h */, + ctype_base::mask(alpha | lower | print) /* i */, + ctype_base::mask(alpha | lower | print) /* j */, + ctype_base::mask(alpha | lower | print) /* k */, + ctype_base::mask(alpha | lower | print) /* l */, + ctype_base::mask(alpha | lower | print) /* m */, + ctype_base::mask(alpha | lower | print) /* n */, + ctype_base::mask(alpha | lower | print) /* o */, + ctype_base::mask(alpha | lower | print) /* p */, + ctype_base::mask(alpha | lower | print) /* q */, + ctype_base::mask(alpha | lower | print) /* r */, + ctype_base::mask(alpha | lower | print) /* s */, + ctype_base::mask(alpha | lower | print) /* t */, + ctype_base::mask(alpha | lower | print) /* u */, + ctype_base::mask(alpha | lower | print) /* v */, + ctype_base::mask(alpha | lower | print) /* w */, + ctype_base::mask(alpha | lower | print) /* x */, + ctype_base::mask(alpha | lower | print) /* y */, + ctype_base::mask(alpha | lower | print) /* x */, + ctype_base::mask(punct | print) /* { */, + ctype_base::mask(punct | print) /* | */, + ctype_base::mask(punct | print) /* } */, + ctype_base::mask(punct | print) /* ~ */, + cntrl /* del (0x7f)*/, + /* The next 128 entries are all 0. */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + return _S_classic_table; + } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_toupper(*__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_tolower(*__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/mingw32/ctype_noninline.h b/libstdc++-v3/config/os/mingw32/ctype_noninline.h deleted file mode 100644 index 10b1fbc490c..00000000000 --- a/libstdc++-v3/config/os/mingw32/ctype_noninline.h +++ /dev/null @@ -1,236 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2007, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// The classic table used in libstdc++ is *not* the C _ctype table -// used by mscvrt, but is based on the ctype masks defined for libstdc++ -// in ctype_base.h. - - const ctype_base::mask* - ctype::classic_table() throw() - { - static const ctype_base::mask _S_classic_table[256] = - { - cntrl /* null */, - cntrl /* ^A */, - cntrl /* ^B */, - cntrl /* ^C */, - cntrl /* ^D */, - cntrl /* ^E */, - cntrl /* ^F */, - cntrl /* ^G */, - cntrl /* ^H */, - ctype_base::mask(space | cntrl) /* tab */, - ctype_base::mask(space | cntrl) /* LF */, - ctype_base::mask(space | cntrl) /* ^K */, - ctype_base::mask(space | cntrl) /* FF */, - ctype_base::mask(space | cntrl) /* ^M */, - cntrl /* ^N */, - cntrl /* ^O */, - cntrl /* ^P */, - cntrl /* ^Q */, - cntrl /* ^R */, - cntrl /* ^S */, - cntrl /* ^T */, - cntrl /* ^U */, - cntrl /* ^V */, - cntrl /* ^W */, - cntrl /* ^X */, - cntrl /* ^Y */, - cntrl /* ^Z */, - cntrl /* esc */, - cntrl /* ^\ */, - cntrl /* ^] */, - cntrl /* ^^ */, - cntrl /* ^_ */, - ctype_base::mask(space | print) /* */, - ctype_base::mask(punct | print) /* ! */, - ctype_base::mask(punct | print) /* " */, - ctype_base::mask(punct | print) /* # */, - ctype_base::mask(punct | print) /* $ */, - ctype_base::mask(punct | print) /* % */, - ctype_base::mask(punct | print) /* & */, - ctype_base::mask(punct | print) /* ' */, - ctype_base::mask(punct | print) /* ( */, - ctype_base::mask(punct | print) /* ) */, - ctype_base::mask(punct | print) /* * */, - ctype_base::mask(punct | print) /* + */, - ctype_base::mask(punct | print) /* , */, - ctype_base::mask(punct | print) /* - */, - ctype_base::mask(punct | print) /* . */, - ctype_base::mask(punct | print) /* / */, - ctype_base::mask(digit | xdigit | print) /* 0 */, - ctype_base::mask(digit | xdigit | print) /* 1 */, - ctype_base::mask(digit | xdigit | print) /* 2 */, - ctype_base::mask(digit | xdigit | print) /* 3 */, - ctype_base::mask(digit | xdigit | print) /* 4 */, - ctype_base::mask(digit | xdigit | print) /* 5 */, - ctype_base::mask(digit | xdigit | print) /* 6 */, - ctype_base::mask(digit | xdigit | print) /* 7 */, - ctype_base::mask(digit | xdigit | print) /* 8 */, - ctype_base::mask(digit | xdigit | print) /* 9 */, - ctype_base::mask(punct | print) /* : */, - ctype_base::mask(punct | print) /* ; */, - ctype_base::mask(punct | print) /* < */, - ctype_base::mask(punct | print) /* = */, - ctype_base::mask(punct | print) /* > */, - ctype_base::mask(punct | print) /* ? */, - ctype_base::mask(punct | print) /* ! */, - ctype_base::mask(alpha | upper | xdigit | print) /* A */, - ctype_base::mask(alpha | upper | xdigit | print) /* B */, - ctype_base::mask(alpha | upper | xdigit | print) /* C */, - ctype_base::mask(alpha | upper | xdigit | print) /* D */, - ctype_base::mask(alpha | upper | xdigit | print) /* E */, - ctype_base::mask(alpha | upper | xdigit | print) /* F */, - ctype_base::mask(alpha | upper | print) /* G */, - ctype_base::mask(alpha | upper | print) /* H */, - ctype_base::mask(alpha | upper | print) /* I */, - ctype_base::mask(alpha | upper | print) /* J */, - ctype_base::mask(alpha | upper | print) /* K */, - ctype_base::mask(alpha | upper | print) /* L */, - ctype_base::mask(alpha | upper | print) /* M */, - ctype_base::mask(alpha | upper | print) /* N */, - ctype_base::mask(alpha | upper | print) /* O */, - ctype_base::mask(alpha | upper | print) /* P */, - ctype_base::mask(alpha | upper | print) /* Q */, - ctype_base::mask(alpha | upper | print) /* R */, - ctype_base::mask(alpha | upper | print) /* S */, - ctype_base::mask(alpha | upper | print) /* T */, - ctype_base::mask(alpha | upper | print) /* U */, - ctype_base::mask(alpha | upper | print) /* V */, - ctype_base::mask(alpha | upper | print) /* W */, - ctype_base::mask(alpha | upper | print) /* X */, - ctype_base::mask(alpha | upper | print) /* Y */, - ctype_base::mask(alpha | upper | print) /* Z */, - ctype_base::mask(punct | print) /* [ */, - ctype_base::mask(punct | print) /* \ */, - ctype_base::mask(punct | print) /* ] */, - ctype_base::mask(punct | print) /* ^ */, - ctype_base::mask(punct | print) /* _ */, - ctype_base::mask(punct | print) /* ` */, - ctype_base::mask(alpha | lower | xdigit | print) /* a */, - ctype_base::mask(alpha | lower | xdigit | print) /* b */, - ctype_base::mask(alpha | lower | xdigit | print) /* c */, - ctype_base::mask(alpha | lower | xdigit | print) /* d */, - ctype_base::mask(alpha | lower | xdigit | print) /* e */, - ctype_base::mask(alpha | lower | xdigit | print) /* f */, - ctype_base::mask(alpha | lower | print) /* g */, - ctype_base::mask(alpha | lower | print) /* h */, - ctype_base::mask(alpha | lower | print) /* i */, - ctype_base::mask(alpha | lower | print) /* j */, - ctype_base::mask(alpha | lower | print) /* k */, - ctype_base::mask(alpha | lower | print) /* l */, - ctype_base::mask(alpha | lower | print) /* m */, - ctype_base::mask(alpha | lower | print) /* n */, - ctype_base::mask(alpha | lower | print) /* o */, - ctype_base::mask(alpha | lower | print) /* p */, - ctype_base::mask(alpha | lower | print) /* q */, - ctype_base::mask(alpha | lower | print) /* r */, - ctype_base::mask(alpha | lower | print) /* s */, - ctype_base::mask(alpha | lower | print) /* t */, - ctype_base::mask(alpha | lower | print) /* u */, - ctype_base::mask(alpha | lower | print) /* v */, - ctype_base::mask(alpha | lower | print) /* w */, - ctype_base::mask(alpha | lower | print) /* x */, - ctype_base::mask(alpha | lower | print) /* y */, - ctype_base::mask(alpha | lower | print) /* x */, - ctype_base::mask(punct | print) /* { */, - ctype_base::mask(punct | print) /* | */, - ctype_base::mask(punct | print) /* } */, - ctype_base::mask(punct | print) /* ~ */, - cntrl /* del (0x7f)*/, - /* The next 128 entries are all 0. */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - return _S_classic_table; - } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = this->do_toupper(*__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = this->do_tolower(*__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/newlib/ctype_configure_char.cc b/libstdc++-v3/config/os/newlib/ctype_configure_char.cc new file mode 100644 index 00000000000..d5a8fe16314 --- /dev/null +++ b/libstdc++-v3/config/os/newlib/ctype_configure_char.cc @@ -0,0 +1,105 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return _ctype_ + 1; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { + int __x = __c; + return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x); + } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_toupper(*__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { + int __x = __c; + return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x); + } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_tolower(*__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/newlib/ctype_noninline.h b/libstdc++-v3/config/os/newlib/ctype_noninline.h deleted file mode 100644 index 947bce589e6..00000000000 --- a/libstdc++-v3/config/os/newlib/ctype_noninline.h +++ /dev/null @@ -1,97 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002, 2009, 2010 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return _ctype_ + 1; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { - int __x = __c; - return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x); - } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = this->do_toupper(*__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { - int __x = __c; - return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x); - } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = this->do_tolower(*__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/qnx/qnx6.1/ctype_configure_char.cc b/libstdc++-v3/config/os/qnx/qnx6.1/ctype_configure_char.cc new file mode 100644 index 00000000000..b6dd7f43204 --- /dev/null +++ b/libstdc++-v3/config/os/qnx/qnx6.1/ctype_configure_char.cc @@ -0,0 +1,97 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return 0; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h b/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h deleted file mode 100644 index b74e070594e..00000000000 --- a/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h +++ /dev/null @@ -1,89 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2002, 2009, 2010 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return 0; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return ::toupper((int) __c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::toupper((int) *__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return ::tolower((int) __c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = ::tolower((int) *__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/ctype_configure_char.cc b/libstdc++-v3/config/os/solaris/solaris2.7/ctype_configure_char.cc new file mode 100644 index 00000000000..d3519429a01 --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.7/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return __ctype_mask; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(__trans_upper), _M_tolower(__trans_lower), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(__trans_upper), _M_tolower(__trans_lower), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[static_cast(__c)]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[static_cast(*__low)]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[static_cast(__c)]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[static_cast(*__low)]; + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h deleted file mode 100644 index 4713c87265b..00000000000 --- a/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h +++ /dev/null @@ -1,92 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return __ctype_mask; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(__trans_upper), _M_tolower(__trans_lower), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(__trans_upper), _M_tolower(__trans_lower), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return _M_toupper[static_cast(__c)]; } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_toupper[static_cast(*__low)]; - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return _M_tolower[static_cast(__c)]; } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_tolower[static_cast(*__low)]; - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/tpf/ctype_configure_char.cc b/libstdc++-v3/config/os/tpf/ctype_configure_char.cc new file mode 100644 index 00000000000..643abd3f728 --- /dev/null +++ b/libstdc++-v3/config/os/tpf/ctype_configure_char.cc @@ -0,0 +1,120 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { + const ctype_base::mask* __ret; + char* __old = setlocale(LC_CTYPE, NULL); + const size_t __len = __builtin_strlen(__old) + 1; + char* __sav = new char[__len]; + __builtin_memcpy(__sav, __old, __len); + setlocale(LC_CTYPE, "C"); + __ret = *__ctype_b_loc(); + setlocale(LC_CTYPE, __sav); + delete [] __sav; + return __ret; + } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del) + { + char* __old = setlocale(LC_CTYPE, NULL); + const size_t __len = __builtin_strlen(__old) + 1; + char* __sav = new char[__len]; + __builtin_memcpy(__sav, __old, __len); + setlocale(LC_CTYPE, "C"); + _M_toupper = *__ctype_toupper_loc(); + _M_tolower = *__ctype_tolower_loc(); + _M_table = __table ? __table : *__ctype_b_loc(); + setlocale(LC_CTYPE, __sav); + delete [] __sav; + _M_c_locale_ctype = _S_get_c_locale(); + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del) + { + char* __old = setlocale(LC_CTYPE, NULL); + const size_t __len = __builtin_strlen(__old) + 1; + char* __sav = new char[__len]; + __builtin_memcpy(__sav, __old, __len); + setlocale(LC_CTYPE, "C"); + _M_toupper = *__ctype_toupper_loc(); + _M_tolower = *__ctype_tolower_loc(); + _M_table = __table ? __table : *__ctype_b_loc(); + setlocale(LC_CTYPE, __sav); + delete [] __sav; + _M_c_locale_ctype = _S_get_c_locale(); + } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[static_cast(__c)]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[static_cast(*__low)]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[static_cast(__c)]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[static_cast(*__low)]; + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/tpf/ctype_noninline.h b/libstdc++-v3/config/os/tpf/ctype_noninline.h deleted file mode 100644 index 251270344c0..00000000000 --- a/libstdc++-v3/config/os/tpf/ctype_noninline.h +++ /dev/null @@ -1,113 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { - const ctype_base::mask* __ret; - char* __old = setlocale(LC_CTYPE, NULL); - const size_t __len = __builtin_strlen(__old) + 1; - char* __sav = new char[__len]; - __builtin_memcpy(__sav, __old, __len); - setlocale(LC_CTYPE, "C"); - __ret = *__ctype_b_loc(); - setlocale(LC_CTYPE, __sav); - delete [] __sav; - return __ret; - } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del) - { - char* __old = setlocale(LC_CTYPE, NULL); - const size_t __len = __builtin_strlen(__old) + 1; - char* __sav = new char[__len]; - __builtin_memcpy(__sav, __old, __len); - setlocale(LC_CTYPE, "C"); - _M_toupper = *__ctype_toupper_loc(); - _M_tolower = *__ctype_tolower_loc(); - _M_table = __table ? __table : *__ctype_b_loc(); - setlocale(LC_CTYPE, __sav); - delete [] __sav; - _M_c_locale_ctype = _S_get_c_locale(); - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del) - { - char* __old = setlocale(LC_CTYPE, NULL); - const size_t __len = __builtin_strlen(__old) + 1; - char* __sav = new char[__len]; - __builtin_memcpy(__sav, __old, __len); - setlocale(LC_CTYPE, "C"); - _M_toupper = *__ctype_toupper_loc(); - _M_tolower = *__ctype_tolower_loc(); - _M_table = __table ? __table : *__ctype_b_loc(); - setlocale(LC_CTYPE, __sav); - delete [] __sav; - _M_c_locale_ctype = _S_get_c_locale(); - } - - char - ctype::do_toupper(char __c) const - { return _M_toupper[static_cast(__c)]; } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_toupper[static_cast(*__low)]; - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return _M_tolower[static_cast(__c)]; } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_tolower[static_cast(*__low)]; - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/uclibc/ctype_configure_char.cc b/libstdc++-v3/config/os/uclibc/ctype_configure_char.cc new file mode 100644 index 00000000000..245c7991725 --- /dev/null +++ b/libstdc++-v3/config/os/uclibc/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return __C_ctype_b; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) + { + _M_toupper = __C_ctype_toupper; + _M_tolower = __C_ctype_tolower; + _M_table = __table ? __table : __C_ctype_b; + memset(_M_widen, 0, sizeof(_M_widen)); + memset(_M_narrow, 0, sizeof(_M_narrow)); + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) + { + _M_toupper = __C_ctype_toupper; + _M_tolower = __C_ctype_tolower; + _M_table = __table ? __table : __C_ctype_b; + memset(_M_widen, 0, sizeof(_M_widen)); + memset(_M_narrow, 0, sizeof(_M_narrow)); + } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[static_cast(__c)]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[static_cast(*__low)]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[static_cast(__c)]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[static_cast(*__low)]; + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/uclibc/ctype_noninline.h b/libstdc++-v3/config/os/uclibc/ctype_noninline.h deleted file mode 100644 index 389e76eb86f..00000000000 --- a/libstdc++-v3/config/os/uclibc/ctype_noninline.h +++ /dev/null @@ -1,92 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return __C_ctype_b; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), - _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) - { - _M_toupper = __C_ctype_toupper; - _M_tolower = __C_ctype_tolower; - _M_table = __table ? __table : __C_ctype_b; - memset(_M_widen, 0, sizeof(_M_widen)); - memset(_M_narrow, 0, sizeof(_M_narrow)); - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), - _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) - { - _M_toupper = __C_ctype_toupper; - _M_tolower = __C_ctype_tolower; - _M_table = __table ? __table : __C_ctype_b; - memset(_M_widen, 0, sizeof(_M_widen)); - memset(_M_narrow, 0, sizeof(_M_narrow)); - } - - char - ctype::do_toupper(char __c) const - { return _M_toupper[static_cast(__c)]; } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_toupper[static_cast(*__low)]; - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return _M_tolower[static_cast(__c)]; } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = _M_tolower[static_cast(*__low)]; - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/config/os/vxworks/ctype_configure_char.cc b/libstdc++-v3/config/os/vxworks/ctype_configure_char.cc new file mode 100644 index 00000000000..7d2904b782d --- /dev/null +++ b/libstdc++-v3/config/os/vxworks/ctype_configure_char.cc @@ -0,0 +1,99 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ctype_configure_char.cc */ + +// +// ISO C++ 14882: 22.1 Locales +// + +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +// Information as gleaned from target/h/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return __ctype; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { + memset(_M_widen, 0, sizeof(_M_widen)); + _M_widen_ok = 0; + memset(_M_narrow, 0, sizeof(_M_narrow)); + _M_narrow_ok = 0; + } + + char + ctype::do_toupper(char __c) const + { return __toupper(__c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = __toupper(*__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return __tolower(__c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = __tolower(*__low); + ++__low; + } + return __high; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/config/os/vxworks/ctype_noninline.h b/libstdc++-v3/config/os/vxworks/ctype_noninline.h deleted file mode 100644 index 23521b76d0f..00000000000 --- a/libstdc++-v3/config/os/vxworks/ctype_noninline.h +++ /dev/null @@ -1,92 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2009, 2010 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file bits/ctype_noninline.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{locale} - */ - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from target/h/ctype.h - - const ctype_base::mask* - ctype::classic_table() throw() - { return __ctype; } - - ctype::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype::do_toupper(char __c) const - { return __toupper(__c); } - - const char* - ctype::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = __toupper(*__low); - ++__low; - } - return __high; - } - - char - ctype::do_tolower(char __c) const - { return __tolower(__c); } - - const char* - ctype::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = __tolower(*__low); - ++__low; - } - return __high; - } diff --git a/libstdc++-v3/doc/xml/manual/internals.xml b/libstdc++-v3/doc/xml/manual/internals.xml index 72af0b835c8..c01735eb4fb 100644 --- a/libstdc++-v3/doc/xml/manual/internals.xml +++ b/libstdc++-v3/doc/xml/manual/internals.xml @@ -254,11 +254,8 @@ not have to include <ctype.h> in this header; it will always included before ctype_base.h is included. - The next file to write is ctype_noninline.h, which also does -not require include guards. This file defines a few member functions -that will be included in include/bits/locale_facets.h. The first -function that must be written is the ctype<char>::ctype -constructor. Here is the IRIX example: + The next file to write is ctype_configure_char.cc. +The first function that must be written is the ctype<char>::ctype constructor. Here is the IRIX example: diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 10ed04c4edb..c581aa4806a 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -827,7 +827,6 @@ host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits host_headers = \ ${host_srcdir}/ctype_base.h \ ${host_srcdir}/ctype_inline.h \ - ${host_srcdir}/ctype_noninline.h \ ${host_srcdir}/os_defines.h \ ${glibcxx_srcdir}/$(ATOMIC_WORD_SRCDIR)/atomic_word.h \ ${glibcxx_srcdir}/$(ABI_TWEAKS_SRCDIR)/cxxabi_tweaks.h \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 01e593d1c31..0da4c464538 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1068,7 +1068,6 @@ host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits host_headers = \ ${host_srcdir}/ctype_base.h \ ${host_srcdir}/ctype_inline.h \ - ${host_srcdir}/ctype_noninline.h \ ${host_srcdir}/os_defines.h \ ${glibcxx_srcdir}/$(ATOMIC_WORD_SRCDIR)/atomic_word.h \ ${glibcxx_srcdir}/$(ABI_TWEAKS_SRCDIR)/cxxabi_tweaks.h \ diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index 9a356855138..5a6cb970822 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -104,6 +104,7 @@ host_sources = \ atomicity.cc \ codecvt_members.cc \ collate_members.cc \ + ctype_configure_char.cc \ ctype_members.cc \ messages_members.cc \ monetary_members.cc \ @@ -116,6 +117,9 @@ codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC) collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC) $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true +ctype_configure_char.cc: ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc + $(LN_S) ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc . || true + ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC) $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index b454f66dc8b..88dca846948 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -89,8 +89,8 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) am__DEPENDENCIES_1 = am__objects_1 = atomicity.lo codecvt_members.lo collate_members.lo \ - ctype_members.lo messages_members.lo monetary_members.lo \ - numeric_members.lo time_members.lo + ctype_configure_char.lo ctype_members.lo messages_members.lo \ + monetary_members.lo numeric_members.lo time_members.lo @ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = allocator-inst.lo \ @ENABLE_EXTERN_TEMPLATE_TRUE@ concept-inst.lo ext-inst.lo \ @ENABLE_EXTERN_TEMPLATE_TRUE@ fstream-inst.lo ios-inst.lo \ @@ -361,6 +361,7 @@ host_sources = \ atomicity.cc \ codecvt_members.cc \ collate_members.cc \ + ctype_configure_char.cc \ ctype_members.cc \ messages_members.cc \ monetary_members.cc \ @@ -829,6 +830,9 @@ codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC) collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC) $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true +ctype_configure_char.cc: ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc + $(LN_S) ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc . || true + ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC) $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true diff --git a/libstdc++-v3/src/ctype.cc b/libstdc++-v3/src/ctype.cc index 04d31cc5744..e246bea10dd 100644 --- a/libstdc++-v3/src/ctype.cc +++ b/libstdc++-v3/src/ctype.cc @@ -1,5 +1,5 @@ // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, -// 2006, 2007, 2008, 2009 +// 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -50,11 +50,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION locale::id ctype::id; #endif - // XXX At some point, just rename this file to ctype_configure_char.cc - // and compile it as a separate file instead of including it here. - // Platform-specific initialization code for ctype tables. -#include - const size_t ctype::table_size; ctype::~ctype()