]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/ext/codecvt_specializations.h
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / ext / codecvt_specializations.h
index 42e3c0f14770f3cb54b005910d98b75c0f14bd99..7306c7d3ac0f146a963aa447784daf8a3d7e3c21 100644 (file)
@@ -1,12 +1,11 @@
 // Locale support (codecvt) -*- C++ -*-
 
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-//  Free Software Foundation, Inc.
+// Copyright (C) 2000-2024 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 2, or (at your option)
+// 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,
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 // GNU General Public License for more details.
 
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
+// 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.
 
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
+// 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
+// <http://www.gnu.org/licenses/>.
 
 //
 // ISO C++ 14882: 22.2.1.5 Template class codecvt
 #ifndef _EXT_CODECVT_SPECIALIZATIONS_H
 #define _EXT_CODECVT_SPECIALIZATIONS_H 1
 
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
 #include <bits/c++config.h>
 #include <locale>
 #include <iconv.h>
 
-_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
 
-  /// @brief  Extension to use iconv for dealing with character encodings.
+  /// Extension to use iconv for dealing with character encodings.
   // This includes conversions and comparisons between various character
   // sets.  This object encapsulates data that may need to be shared between
   // char_traits, codecvt and ctype.
@@ -206,25 +205,30 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
     }
   };
 
-  /// @brief  encoding_char_traits.
+  /// encoding_char_traits
   // Custom traits type with encoding_state for the state type, and the
   // associated fpos<encoding_state> for the position type, all other
   // bits equivalent to the required char_traits instantiations.
   template<typename _CharT>
-    struct encoding_char_traits : public std::char_traits<_CharT>
+    struct encoding_char_traits
+    : public std::char_traits<_CharT>
     {
       typedef encoding_state                           state_type;
       typedef typename std::fpos<state_type>           pos_type;
     };
 
-_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE_CXX11
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
 
 
-_GLIBCXX_BEGIN_NAMESPACE(std)
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   using __gnu_cxx::encoding_state;
 
-  /// @brief  codecvt<InternT, _ExternT, encoding_state> specialization.
+  /// codecvt<InternT, _ExternT, encoding_state> specialization.
   // This partial specialization takes advantage of iconv to provide
   // code conversions between a large number of character encodings.
   template<typename _InternT, typename _ExternT>
@@ -386,7 +390,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
          // Argument list for iconv specifies a byte sequence. Thus,
          // all to/from arrays must be brutally casted to char*.
          char* __cto = reinterpret_cast<char*>(__to);
-         size_t __conv = __iconv_adaptor(iconv,__desc, NULL, NULL,
+         size_t __conv = __iconv_adaptor(iconv,__desc, 0, 0,
                                           &__cto, &__tlen); 
          
          if (__conv != size_t(-1))
@@ -507,6 +511,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     do_max_length() const throw()
     { return 1; }
 
-_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
 
 #endif