This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] codecvt/ctype make work


This simplifies some of the build machinery, and keeps the gnu and
generic locale models separate.

At some point, config/os/*/ctype_noninline.h should be renamed to
/config/os/*/ctype_members_char.cc or some such, and be wrapped in
namespace std. 

tested x86/linux
tested x86/linux --enable-clocale=generic

2002-09-10  Benjamin Kosnik  <bkoz@redhat.com>

	* src/Makefile.am (sources): Edit.
	(target_sources): New.
	(target_sources_extra): New.
	* src/Makefile.in: Regenerate.
	* acinclude.m4: Set CCODECVT_CC. 
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* src/locale.cc: Move ctype definitions...
	* src/ctype.cc: ...here. New file. 
	* src/locale.cc: Move codecvt definitions...
	* src/codecvt.cc: ...here. 	
	* config/generic/codecvt_members.cc: ...and here. 	
	* config/gnu/codecvt_members.cc: ...and here. 		
	* include/bits/codecvt.h: Tweak.
	* include/bits/locale_facets: Tweak.

	* src/bitset.cc: Correct license text.
	* src/concept-inst.cc: Same.
	* src/strstream.cc: Same.
	* src/vterminate.cc: Same.	

Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.218
diff -c -p -r1.218 acinclude.m4
*** acinclude.m4	5 Sep 2002 07:46:08 -0000	1.218
--- acinclude.m4	11 Sep 2002 02:24:35 -0000
*************** AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
*** 1175,1180 ****
--- 1175,1181 ----
        CLOCALE_H=config/locale/generic/c_locale.h
        CLOCALE_CC=config/locale/generic/c_locale.cc
        CCODECVT_H=config/locale/generic/codecvt_specializations.h
+       CCODECVT_CC=config/locale/generic/codecvt_members.cc
        CCOLLATE_CC=config/locale/generic/collate_members.cc
        CCTYPE_CC=config/locale/generic/ctype_members.cc
        CMESSAGES_H=config/locale/generic/messages_members.h
*************** AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
*** 1208,1213 ****
--- 1209,1215 ----
        CLOCALE_H=config/locale/gnu/c_locale.h
        CLOCALE_CC=config/locale/gnu/c_locale.cc
        CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
+       CCODECVT_CC=config/locale/gnu/codecvt_members.cc
        CCOLLATE_CC=config/locale/gnu/collate_members.cc
        CCTYPE_CC=config/locale/gnu/ctype_members.cc
        CMESSAGES_H=config/locale/gnu/messages_members.h
*************** AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
*** 1223,1228 ****
--- 1225,1231 ----
        CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
        CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
        CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
+       CCODECVT_CC=config/locale/generic/codecvt_members.cc
        CCOLLATE_CC=config/locale/generic/collate_members.cc
        CCTYPE_CC=config/locale/generic/ctype_members.cc
        CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
*************** AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
*** 1243,1259 ****
    glibcpp_localedir=${glibcpp_builddir}/po/share/locale
    AC_SUBST(glibcpp_localedir)
  
    AC_SUBST(USE_NLS)
    AC_SUBST(CLOCALE_H)
    AC_SUBST(CCODECVT_H)
    AC_SUBST(CMESSAGES_H)
    AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
!   AC_LINK_FILES($CCOLLATE_CC, src/collate.cc)
!   AC_LINK_FILES($CCTYPE_CC, src/ctype.cc)
!   AC_LINK_FILES($CMESSAGES_CC, src/messages.cc)
!   AC_LINK_FILES($CMONEY_CC, src/monetary.cc)
!   AC_LINK_FILES($CNUMERIC_CC, src/numeric.cc)
!   AC_LINK_FILES($CTIME_CC, src/time.cc)
    AC_LINK_FILES($CLOCALE_INTERNAL_H, src/c++locale_internal.h)
  ])
  
--- 1246,1267 ----
    glibcpp_localedir=${glibcpp_builddir}/po/share/locale
    AC_SUBST(glibcpp_localedir)
  
+   # For the time being, transform ctype_noninline.h to ctype_members_char.cc
+ #  CCTYPE_CHAR_CC=config/${os_include_dir}/ctype_noninline.h
+ 
    AC_SUBST(USE_NLS)
    AC_SUBST(CLOCALE_H)
    AC_SUBST(CCODECVT_H)
    AC_SUBST(CMESSAGES_H)
    AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
!   AC_LINK_FILES($CCODECVT_CC, src/codecvt_members.cc)
!   AC_LINK_FILES($CCOLLATE_CC, src/collate_members.cc)
! #  AC_LINK_FILES($CCTYPE_CHAR_CC, src/ctype_members_char.cc)
!   AC_LINK_FILES($CCTYPE_CC, src/ctype_members.cc)
!   AC_LINK_FILES($CMESSAGES_CC, src/messages_members.cc)
!   AC_LINK_FILES($CMONEY_CC, src/monetary_members.cc)
!   AC_LINK_FILES($CNUMERIC_CC, src/numeric_members.cc)
!   AC_LINK_FILES($CTIME_CC, src/time_members.cc)
    AC_LINK_FILES($CLOCALE_INTERNAL_H, src/c++locale_internal.h)
  ])
  
Index: config/locale/generic/codecvt_members.cc
===================================================================
RCS file: config/locale/generic/codecvt_members.cc
diff -N config/locale/generic/codecvt_members.cc
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/locale/generic/codecvt_members.cc	11 Sep 2002 02:25:02 -0000
***************
*** 0 ****
--- 1,101 ----
+ // std::codecvt implementation details, generic version -*- C++ -*-
+ 
+ // Copyright (C) 2002 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)
+ // 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.
+ 
+ // 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+ 
+ // 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.
+ 
+ //
+ // ISO C++ 14882: 22.2.1.5 - Template class codecvt
+ //
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
+ #include <locale>
+ #include "c++locale_internal.h"
+ 
+ namespace std
+ {
+   // Specializations.
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   codecvt_base::result
+   codecvt<wchar_t, char, mbstate_t>::
+   do_out(state_type& __state, const intern_type* __from, 
+ 	 const intern_type* __from_end, const intern_type*& __from_next,
+ 	 extern_type* __to, extern_type* __to_end,
+ 	 extern_type*& __to_next) const
+   {
+     result __ret = error;
+     size_t __len = min(__from_end - __from, __to_end - __to);
+     size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
+ 
+     if (__conv == __len)
+       {
+ 	__from_next = __from;
+ 	__to_next = __to + __conv;
+ 	__ret = ok;
+       }
+     else if (__conv > 0 && __conv < __len)
+       {
+ 	__from_next = __from;
+ 	__to_next = __to + __conv;
+ 	__ret = partial;
+       }
+     else
+       __ret = error;
+ 	
+     return __ret; 
+   }
+   
+   codecvt_base::result
+   codecvt<wchar_t, char, mbstate_t>::
+   do_in(state_type& __state, const extern_type* __from, 
+ 	const extern_type* __from_end, const extern_type*& __from_next,
+ 	intern_type* __to, intern_type* __to_end,
+ 	intern_type*& __to_next) const
+   {
+     result __ret = error;
+     size_t __len = min(__from_end - __from, __to_end - __to);
+     size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
+ 
+     if (__conv == __len)
+       {
+ 	__from_next = __from;
+ 	__to_next = __to + __conv;
+ 	__ret = ok;
+       }
+     else if (__conv > 0 && __conv < __len)
+       {
+ 	__from_next = __from;
+ 	__to_next = __to + __conv;
+ 	__ret = partial;
+       }
+     else
+       __ret = error;
+ 	
+     return __ret; 
+   }
+ #endif
+ }
Index: config/locale/gnu/codecvt_members.cc
===================================================================
RCS file: config/locale/gnu/codecvt_members.cc
diff -N config/locale/gnu/codecvt_members.cc
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/locale/gnu/codecvt_members.cc	11 Sep 2002 02:25:02 -0000
***************
*** 0 ****
--- 1,113 ----
+ // std::codecvt implementation details, GNU version -*- C++ -*-
+ 
+ // Copyright (C) 2002 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)
+ // 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.
+ 
+ // 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+ 
+ // 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.
+ 
+ //
+ // ISO C++ 14882: 22.2.1.5 - Template class codecvt
+ //
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
+ #include <locale>
+ #include "c++locale_internal.h"
+ 
+ namespace std
+ {
+   // Specializations.
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   codecvt_base::result
+   codecvt<wchar_t, char, mbstate_t>::
+   do_out(state_type& __state, const intern_type* __from, 
+ 	 const intern_type* __from_end, const intern_type*& __from_next,
+ 	 extern_type* __to, extern_type* __to_end,
+ 	 extern_type*& __to_next) const
+   {
+     result __ret = error;
+     size_t __len = min(__from_end - __from, __to_end - __to);
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+     __c_locale __old = __uselocale(_M_c_locale_codecvt);
+ #endif
+     size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+     __uselocale(__old);
+ #endif
+ 
+     if (__conv == __len)
+       {
+ 	__from_next = __from;
+ 	__to_next = __to + __conv;
+ 	__ret = ok;
+       }
+     else if (__conv > 0 && __conv < __len)
+       {
+ 	__from_next = __from;
+ 	__to_next = __to + __conv;
+ 	__ret = partial;
+       }
+     else
+       __ret = error;
+ 	
+     return __ret; 
+   }
+   
+   codecvt_base::result
+   codecvt<wchar_t, char, mbstate_t>::
+   do_in(state_type& __state, const extern_type* __from, 
+ 	const extern_type* __from_end, const extern_type*& __from_next,
+ 	intern_type* __to, intern_type* __to_end,
+ 	intern_type*& __to_next) const
+   {
+     result __ret = error;
+     size_t __len = min(__from_end - __from, __to_end - __to);
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+     __c_locale __old = __uselocale(_M_c_locale_codecvt);
+ #endif
+     size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+     __uselocale(__old);
+ #endif
+ 
+     if (__conv == __len)
+       {
+ 	__from_next = __from;
+ 	__to_next = __to + __conv;
+ 	__ret = ok;
+       }
+     else if (__conv > 0 && __conv < __len)
+       {
+ 	__from_next = __from;
+ 	__to_next = __to + __conv;
+ 	__ret = partial;
+       }
+     else
+       __ret = error;
+ 	
+     return __ret; 
+   }
+ #endif
+ }
Index: include/bits/codecvt.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/codecvt.h,v
retrieving revision 1.19
diff -c -p -r1.19 codecvt.h
*** include/bits/codecvt.h	10 Sep 2002 19:35:03 -0000	1.19
--- include/bits/codecvt.h	11 Sep 2002 02:25:03 -0000
***************
*** 1,6 ****
  // Locale support (codecvt) -*- C++ -*-
  
! // Copyright (C) 2000, 2001 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
--- 1,6 ----
  // Locale support (codecvt) -*- C++ -*-
  
! // Copyright (C) 2000, 2001, 2002 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
***************
*** 66,80 ****
      {
      public:
        // Types:
!       typedef codecvt_base::result			result;
!       typedef _InternT 					intern_type;
!       typedef _ExternT 					extern_type;
!       typedef _StateT  					state_type;
!  
!     protected:
!       __c_locale		_M_c_locale_codecvt;
! 
!     public:
        // 22.2.1.5.1 codecvt members
        result
        out(state_type& __state, const intern_type* __from, 
--- 66,76 ----
      {
      public:
        // Types:
!       typedef codecvt_base::result	result;
!       typedef _InternT 			intern_type;
!       typedef _ExternT 			extern_type;
!       typedef _StateT  			state_type;
!       
        // 22.2.1.5.1 codecvt members
        result
        out(state_type& __state, const intern_type* __from, 
***************
*** 163,179 ****
      {
      public:      
        // Types:
!       typedef codecvt_base::result			result;
!       typedef _InternT intern_type;
!       typedef _ExternT extern_type;
!       typedef _StateT  state_type;
  
!       // Data Members:
!       static locale::id id;
  
        explicit 
        codecvt(size_t __refs = 0) 
!       : __codecvt_abstract_base<_InternT,_ExternT,_StateT> (__refs) { }
  
      protected:
        virtual 
--- 159,181 ----
      {
      public:      
        // Types:
!       typedef codecvt_base::result	result;
!       typedef _InternT 			intern_type;
!       typedef _ExternT 			extern_type;
!       typedef _StateT  			state_type;
  
!     protected:
!       __c_locale			_M_c_locale_codecvt;
! 
!     public:
!       static locale::id 		id;
  
        explicit 
        codecvt(size_t __refs = 0) 
!       : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs) { }
! 
!       explicit 
!       codecvt(__c_locale __cloc, size_t __refs = 0);
  
      protected:
        virtual 
***************
*** 219,237 ****
      {
      public:      
        // Types:
!       typedef char 	intern_type;
!       typedef char 	extern_type;
!       typedef mbstate_t state_type;
  
!       // Data Members:
        static locale::id id;
  
        explicit 
        codecvt(size_t __refs = 0);
  
-       // Non-standard.
        explicit 
!       codecvt(__c_locale __cloc, size_t __refs = 0); 
  
      protected:
        virtual 
--- 221,241 ----
      {
      public:      
        // Types:
!       typedef char 			intern_type;
!       typedef char 			extern_type;
!       typedef mbstate_t 		state_type;
! 
!     protected:
!       __c_locale			_M_c_locale_codecvt;
  
!     public:
        static locale::id id;
  
        explicit 
        codecvt(size_t __refs = 0);
  
        explicit 
!       codecvt(__c_locale __cloc, size_t __refs = 0);
  
      protected:
        virtual 
***************
*** 275,291 ****
      {
      public:
        // Types:
!       typedef wchar_t 	intern_type;
!       typedef char 	extern_type;
!       typedef mbstate_t state_type;
  
!       // Data Members:
!       static locale::id id;
  
        explicit 
        codecvt(size_t __refs = 0);
  
-       // Non-standard.
        explicit 
        codecvt(__c_locale __cloc, size_t __refs = 0);
  
--- 279,297 ----
      {
      public:
        // Types:
!       typedef wchar_t 			intern_type;
!       typedef char 			extern_type;
!       typedef mbstate_t 		state_type;
  
!     protected:
!       __c_locale			_M_c_locale_codecvt;
! 
!     public:
!       static locale::id 		id;
  
        explicit 
        codecvt(size_t __refs = 0);
  
        explicit 
        codecvt(__c_locale __cloc, size_t __refs = 0);
  
Index: include/bits/locale_facets.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.h,v
retrieving revision 1.46
diff -c -p -r1.46 locale_facets.h
*** include/bits/locale_facets.h	5 Sep 2002 07:46:17 -0000	1.46
--- include/bits/locale_facets.h	11 Sep 2002 02:25:05 -0000
*************** namespace std
*** 847,853 ****
        : locale::facet(__refs)
        { _M_c_locale_collate = _S_c_locale; }
  
-       // Non-standard.
        explicit 
        collate(__c_locale __cloc, size_t __refs = 0) 
        : locale::facet(__refs)
--- 847,852 ----
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.111
diff -c -p -r1.111 Makefile.am
*** src/Makefile.am	31 Jul 2002 02:47:34 -0000	1.111
--- src/Makefile.am	11 Sep 2002 02:25:05 -0000
*************** INCLUDES = \
*** 60,71 ****
  	$(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
  	$(TOPLEVEL_INCLUDES)
  
! sources = \
  	basic_file.cc \
  	bitset.cc \
- 	c++locale.cc \
  	codecvt.cc \
- 	collate.cc \
  	complex_io.cc \
  	concept-inst.cc \
  	ctype.cc \
--- 60,85 ----
  	$(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
  	$(TOPLEVEL_INCLUDES)
  
! # Source files linked in via configuration magic for a particular target.
! target_sources = \
! 	codecvt_members.cc \
! 	collate_members.cc \
! 	ctype_members.cc \
! 	messages_members.cc \
! 	monetary_members.cc \
! 	numeric_members.cc \
! 	time_members.cc
! 
! # Source files linked in via configuration magic for a particular
! # target, but with ad hoc naming rules.
! target_sources_extra = \
  	basic_file.cc \
+ 	c++locale.cc 
+ 
+ # Sources present in the src directory.
+ sources = \
  	bitset.cc \
  	codecvt.cc \
  	complex_io.cc \
  	concept-inst.cc \
  	ctype.cc \
*************** sources = \
*** 78,90 ****
  	ios.cc \
  	istream-inst.cc \
  	limits.cc \
- 	locale-inst.cc \
  	locale.cc \
  	localename.cc \
- 	messages.cc \
  	misc-inst.cc \
- 	monetary.cc \
- 	numeric.cc \
  	ostream-inst.cc \
  	sstream-inst.cc \
  	stdexcept.cc \
--- 92,101 ----
  	ios.cc \
  	istream-inst.cc \
  	limits.cc \
  	locale.cc \
+ 	locale-inst.cc \
  	localename.cc \
  	misc-inst.cc \
  	ostream-inst.cc \
  	sstream-inst.cc \
  	stdexcept.cc \
*************** sources = \
*** 92,102 ****
  	streambuf-inst.cc \
  	string-inst.cc \
  	strstream.cc \
- 	time.cc \
  	valarray-inst.cc \
  	vterminate.cc \
! 	wstring-inst.cc
! 
  
  VPATH = $(top_srcdir)/src:$(top_srcdir)
  
--- 103,113 ----
  	streambuf-inst.cc \
  	string-inst.cc \
  	strstream.cc \
  	valarray-inst.cc \
  	vterminate.cc \
! 	wstring-inst.cc \
! 	${target_sources} \
! 	${target_sources_extra}
  
  VPATH = $(top_srcdir)/src:$(top_srcdir)
  
Index: src/bitset.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/bitset.cc,v
retrieving revision 1.9
diff -c -p -r1.9 bitset.cc
*** src/bitset.cc	3 Jun 2002 04:45:03 -0000	1.9
--- src/bitset.cc	11 Sep 2002 02:25:06 -0000
***************
*** 2,23 ****
  
  // Copyright (C) 2001, 2002 Free Software Foundation
  //
! // This file is part of GNU CC.
! //
! // GNU CC 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)
  // any later version.
! //
! // GNU CC 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.
! //
! // You should have received a copy of the GNU General Public License
! // along with GNU CC; see the file COPYING.  If not, write to
! // the Free Software Foundation, 59 Temple Place - Suite 330,
! // Boston, MA 02111-1307, USA.
  
  // As a special exception, you may use this file as part of a free software
  // library without restriction.  Specifically, if other files instantiate
--- 2,22 ----
  
  // Copyright (C) 2001, 2002 Free Software Foundation
  //
! // 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)
  // 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.
! 
! // 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
! // USA.
  
  // As a special exception, you may use this file as part of a free software
  // library without restriction.  Specifically, if other files instantiate
Index: src/codecvt.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/codecvt.cc,v
retrieving revision 1.11
diff -c -p -r1.11 codecvt.cc
*** src/codecvt.cc	10 Sep 2002 19:35:04 -0000	1.11
--- src/codecvt.cc	11 Sep 2002 02:25:06 -0000
***************
*** 31,36 ****
--- 31,43 ----
  
  namespace std 
  {
+   // Definitions for locale::id of standard facets that are specialized.
+  locale::id codecvt<char, char, mbstate_t>::id;
+ 
+ #ifdef _GLIBCPP_USE_WCHAR_T  
+   locale::id codecvt<wchar_t, char, mbstate_t>::id;
+ #endif
+ 
  #ifdef _GLIBCPP_USE___ENC_TRAITS
    // Definitions for static const data members of __enc_traits.
    const int __enc_traits::_S_max_size;
*************** namespace std 
*** 132,212 ****
    
    codecvt_base::result
    codecvt<wchar_t, char, mbstate_t>::
-   do_out(state_type& __state, const intern_type* __from, 
- 	 const intern_type* __from_end, const intern_type*& __from_next,
- 	 extern_type* __to, extern_type* __to_end,
- 	 extern_type*& __to_next) const
-   {
-     result __ret = error;
-     size_t __len = min(__from_end - __from, __to_end - __to);
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
-     __c_locale __old = __uselocale(_M_c_locale_codecvt);
- #endif
-     size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
-     __uselocale(__old);
- #endif
- 
-     if (__conv == __len)
-       {
- 	__from_next = __from;
- 	__to_next = __to + __conv;
- 	__ret = ok;
-       }
-     else if (__conv > 0 && __conv < __len)
-       {
- 	__from_next = __from;
- 	__to_next = __to + __conv;
- 	__ret = partial;
-       }
-     else
-       __ret = error;
- 	
-     return __ret; 
-   }
-   
-   codecvt_base::result
-   codecvt<wchar_t, char, mbstate_t>::
    do_unshift(state_type&, extern_type* __to,
  	     extern_type*, extern_type*& __to_next) const
    {
      __to_next = __to;
      return noconv;
-   }
-   
-   codecvt_base::result
-   codecvt<wchar_t, char, mbstate_t>::
-   do_in(state_type& __state, const extern_type* __from, 
- 	const extern_type* __from_end, const extern_type*& __from_next,
- 	intern_type* __to, intern_type* __to_end,
- 	intern_type*& __to_next) const
-   {
-     result __ret = error;
-     size_t __len = min(__from_end - __from, __to_end - __to);
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
-     __c_locale __old = __uselocale(_M_c_locale_codecvt);
- #endif
-     size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
-     __uselocale(__old);
- #endif
- 
-     if (__conv == __len)
-       {
- 	__from_next = __from;
- 	__to_next = __to + __conv;
- 	__ret = ok;
-       }
-     else if (__conv > 0 && __conv < __len)
-       {
- 	__from_next = __from;
- 	__to_next = __to + __conv;
- 	__ret = partial;
-       }
-     else
-       __ret = error;
- 	
-     return __ret; 
    }
    
    int 
--- 139,149 ----
Index: src/concept-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/concept-inst.cc,v
retrieving revision 1.5
diff -c -p -r1.5 concept-inst.cc
*** src/concept-inst.cc	17 Apr 2002 06:20:18 -0000	1.5
--- src/concept-inst.cc	11 Sep 2002 02:25:08 -0000
***************
*** 2,23 ****
  
  // Copyright (C) 2001, 2002 Free Software Foundation
  //
! // This file is part of GNU CC.
! //
! // GNU CC 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)
  // any later version.
! // 
! // GNU CC 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.
! // 
! // You should have received a copy of the GNU General Public License
! // along with GNU CC; see the file COPYING.  If not, write to
! // the Free Software Foundation, 59 Temple Place - Suite 330,
! // Boston, MA 02111-1307, USA.
  
  // As a special exception, you may use this file as part of a free software
  // library without restriction.  Specifically, if other files instantiate
--- 2,22 ----
  
  // Copyright (C) 2001, 2002 Free Software Foundation
  //
! // 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)
  // 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.
! 
! // 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
! // USA.
  
  // As a special exception, you may use this file as part of a free software
  // library without restriction.  Specifically, if other files instantiate
Index: src/ctype.cc
===================================================================
RCS file: src/ctype.cc
diff -N src/ctype.cc
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- src/ctype.cc	11 Sep 2002 02:25:08 -0000
***************
*** 0 ****
--- 1,153 ----
+ // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+ // 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)
+ // 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.
+ 
+ // 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+ 
+ // 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.
+ 
+ #include <locale>
+ 
+ namespace std 
+ {
+   // XXX At some point, just rename this file to ctype_members_char.cc
+   // and compile it as a separate file instead of including it here.
+   // Platform-specific initialization code for ctype tables.
+   #include <bits/ctype_noninline.h>
+ 
+   // Definitions for locale::id of standard facets that are specialized.
+   locale::id ctype<char>::id;
+ 
+ #ifdef _GLIBCPP_USE_WCHAR_T  
+   locale::id ctype<wchar_t>::id;
+ #endif
+ 
+   template<>
+     const ctype<char>&
+     use_facet<ctype<char> >(const locale& __loc)
+     {
+       size_t __i = ctype<char>::id._M_id();
+       const locale::_Impl* __tmp = __loc._M_impl;
+       return static_cast<const ctype<char>&>(*(__tmp->_M_facets[__i]));
+     }
+ 
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   template<>
+     const ctype<wchar_t>&
+     use_facet<ctype<wchar_t> >(const locale& __loc)
+     {
+       size_t __i = ctype<wchar_t>::id._M_id();
+       const locale::_Impl* __tmp = __loc._M_impl;
+       return static_cast<const ctype<wchar_t>&>(*(__tmp->_M_facets[__i]));
+     }
+ #endif
+ 
+   // Definitions for static const data members of ctype_base.
+   const ctype_base::mask ctype_base::space;
+   const ctype_base::mask ctype_base::print;
+   const ctype_base::mask ctype_base::cntrl;
+   const ctype_base::mask ctype_base::upper;
+   const ctype_base::mask ctype_base::lower;
+   const ctype_base::mask ctype_base::alpha;
+   const ctype_base::mask ctype_base::digit;
+   const ctype_base::mask ctype_base::punct;
+   const ctype_base::mask ctype_base::xdigit;
+   const ctype_base::mask ctype_base::alnum;
+   const ctype_base::mask ctype_base::graph;
+ 
+   const size_t ctype<char>::table_size;
+ 
+   ctype<char>::~ctype()
+   { 
+     if (_M_c_locale_ctype != _S_c_locale)
+       _S_destroy_c_locale(_M_c_locale_ctype);
+     if (_M_del) 
+       delete[] this->table(); 
+   }
+ 
+   // These are dummy placeholders as these virtual functions are never called.
+   bool 
+   ctype<char>::do_is(mask, char_type) const 
+   { return false; }
+   
+   const char*
+   ctype<char>::do_is(const char_type* __c, const char_type*, mask*) const 
+   { return __c; }
+   
+   const char*
+   ctype<char>::do_scan_is(mask, const char_type* __c, const char_type*) const 
+   { return __c; }
+ 
+   const char* 
+   ctype<char>::do_scan_not(mask, const char_type* __c, const char_type*) const
+   { return __c; }
+ 
+   char
+   ctype<char>::do_widen(char __c) const
+   { return __c; }
+   
+   const char* 
+   ctype<char>::do_widen(const char* __lo, const char* __hi, char* __dest) const
+   {
+     memcpy(__dest, __lo, __hi - __lo);
+     return __hi;
+   }
+   
+   char
+   ctype<char>::do_narrow(char __c, char /*__dfault*/) const
+   { return __c; }
+   
+   const char* 
+   ctype<char>::do_narrow(const char* __lo, const char* __hi, 
+ 			 char /*__dfault*/, char* __dest) const
+   {
+     memcpy(__dest, __lo, __hi - __lo);
+     return __hi;
+   }
+ 
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   ctype<wchar_t>::ctype(size_t __refs) 
+   : __ctype_abstract_base<wchar_t>(__refs)
+   { _M_c_locale_ctype = _S_c_locale; }
+ 
+   ctype<wchar_t>::ctype(__c_locale __cloc, size_t __refs) 
+   : __ctype_abstract_base<wchar_t>(__refs) 
+   { _M_c_locale_ctype = _S_clone_c_locale(__cloc); }
+ 
+   ctype<wchar_t>::~ctype() 
+   { 
+     if (_M_c_locale_ctype != _S_c_locale)
+       _S_destroy_c_locale(_M_c_locale_ctype); 
+   }
+ 
+   template<>
+     ctype_byname<wchar_t>::ctype_byname(const char* __s, size_t __refs)
+     : ctype<wchar_t>(__refs) 
+     { 	
+       if (_M_c_locale_ctype != _S_c_locale)
+ 	_S_destroy_c_locale(_M_c_locale_ctype);
+       _S_create_c_locale(_M_c_locale_ctype, __s); 
+     }
+ #endif
+ } // namespace std
+ 
Index: src/locale.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale.cc,v
retrieving revision 1.64
diff -c -p -r1.64 locale.cc
*** src/locale.cc	5 Sep 2002 21:13:07 -0000	1.64
--- src/locale.cc	11 Sep 2002 02:25:08 -0000
*************** namespace std 
*** 59,73 ****
    locale::_Impl* 		locale::_S_global; 
    const size_t 			locale::_S_num_categories;
  
-   // Definitions for locale::id of standard facets that are specialized.
-   locale::id ctype<char>::id;
-   locale::id codecvt<char, char, mbstate_t>::id;
- 
- #ifdef _GLIBCPP_USE_WCHAR_T  
-   locale::id ctype<wchar_t>::id;
-   locale::id codecvt<wchar_t, char, mbstate_t>::id;
- #endif
- 
    // Definitions for static const data members of locale::id
    _Atomic_word locale::id::_S_highwater;  // init'd to 0 by linker
  
--- 59,64 ----
*************** namespace std 
*** 397,493 ****
    locale::id::id() 
    { }
  
-   // Definitions for static const data members of ctype_base.
-   const ctype_base::mask ctype_base::space;
-   const ctype_base::mask ctype_base::print;
-   const ctype_base::mask ctype_base::cntrl;
-   const ctype_base::mask ctype_base::upper;
-   const ctype_base::mask ctype_base::lower;
-   const ctype_base::mask ctype_base::alpha;
-   const ctype_base::mask ctype_base::digit;
-   const ctype_base::mask ctype_base::punct;
-   const ctype_base::mask ctype_base::xdigit;
-   const ctype_base::mask ctype_base::alnum;
-   const ctype_base::mask ctype_base::graph;
- 
-   // Platform-specific initialization code for ctype tables.
-   #include <bits/ctype_noninline.h>
- 
-   const size_t ctype<char>::table_size;
- 
-   ctype<char>::~ctype()
-   { 
-     if (_M_c_locale_ctype != _S_c_locale)
-       _S_destroy_c_locale(_M_c_locale_ctype);
-     if (_M_del) 
-       delete[] this->table(); 
-   }
- 
-   // These are dummy placeholders as these virtual functions are never called.
-   bool 
-   ctype<char>::do_is(mask, char_type) const 
-   { return false; }
-   
-   const char*
-   ctype<char>::do_is(const char_type* __c, const char_type*, mask*) const 
-   { return __c; }
-   
-   const char*
-   ctype<char>::do_scan_is(mask, const char_type* __c, const char_type*) const 
-   { return __c; }
- 
-   const char* 
-   ctype<char>::do_scan_not(mask, const char_type* __c, const char_type*) const
-   { return __c; }
- 
-   char
-   ctype<char>::do_widen(char __c) const
-   { return __c; }
-   
-   const char* 
-   ctype<char>::do_widen(const char* __lo, const char* __hi, char* __dest) const
-   {
-     memcpy(__dest, __lo, __hi - __lo);
-     return __hi;
-   }
-   
-   char
-   ctype<char>::do_narrow(char __c, char /*__dfault*/) const
-   { return __c; }
-   
-   const char* 
-   ctype<char>::do_narrow(const char* __lo, const char* __hi, 
- 			 char /*__dfault*/, char* __dest) const
-   {
-     memcpy(__dest, __lo, __hi - __lo);
-     return __hi;
-   }
- 
- #ifdef _GLIBCPP_USE_WCHAR_T
-   ctype<wchar_t>::ctype(size_t __refs) 
-   : __ctype_abstract_base<wchar_t>(__refs)
-   { _M_c_locale_ctype = _S_c_locale; }
- 
-   ctype<wchar_t>::ctype(__c_locale __cloc, size_t __refs) 
-   : __ctype_abstract_base<wchar_t>(__refs) 
-   { _M_c_locale_ctype = _S_clone_c_locale(__cloc); }
- 
-   ctype<wchar_t>::~ctype() 
-   { 
-     if (_M_c_locale_ctype != _S_c_locale)
-       _S_destroy_c_locale(_M_c_locale_ctype); 
-   }
- 
-   template<>
-     ctype_byname<wchar_t>::ctype_byname(const char* __s, size_t __refs)
-     : ctype<wchar_t>(__refs) 
-     { 	
-       if (_M_c_locale_ctype != _S_c_locale)
- 	_S_destroy_c_locale(_M_c_locale_ctype);
-       _S_create_c_locale(_M_c_locale_ctype, __s); 
-     }
- #endif
- 
    // Definitions for static const data members of time_base
    template<> 
      const char*
--- 388,393 ----
*************** namespace std 
*** 510,535 ****
    // Definitions for static const data members of money_base
    const money_base::pattern 
    money_base::_S_default_pattern =  { {symbol, sign, none, value} };
- 
-   template<>
-     const ctype<char>&
-     use_facet<ctype<char> >(const locale& __loc)
-     {
-       size_t __i = ctype<char>::id._M_id();
-       const locale::_Impl* __tmp = __loc._M_impl;
-       return static_cast<const ctype<char>&>(*(__tmp->_M_facets[__i]));
-     }
- 
- #ifdef _GLIBCPP_USE_WCHAR_T
-   template<>
-     const ctype<wchar_t>&
-     use_facet<ctype<wchar_t> >(const locale& __loc)
-     {
-       size_t __i = ctype<wchar_t>::id._M_id();
-       const locale::_Impl* __tmp = __loc._M_impl;
-       return static_cast<const ctype<wchar_t>&>(*(__tmp->_M_facets[__i]));
-     }
- #endif
  
    const char __num_base::_S_atoms[] = "0123456789eEabcdfABCDF";
  
--- 410,415 ----
Index: src/strstream.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/strstream.cc,v
retrieving revision 1.13
diff -c -p -r1.13 strstream.cc
*** src/strstream.cc	2 Aug 2002 16:04:15 -0000	1.13
--- src/strstream.cc	11 Sep 2002 02:25:08 -0000
***************
*** 2,23 ****
  
  // Copyright (C) 2001, 2002 Free Software Foundation
  //
! // This file is part of GNU CC.
! //
! // GNU CC 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)
  // any later version.
! // 
! // GNU CC 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.
! // 
! // You should have received a copy of the GNU General Public License
! // along with GNU CC; see the file COPYING.  If not, write to
! // the Free Software Foundation, 59 Temple Place - Suite 330,
! // Boston, MA 02111-1307, USA.
  
  // As a special exception, you may use this file as part of a free software
  // library without restriction.  Specifically, if other files instantiate
--- 2,22 ----
  
  // Copyright (C) 2001, 2002 Free Software Foundation
  //
! // 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)
  // 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.
! 
! // 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
! // USA.
  
  // As a special exception, you may use this file as part of a free software
  // library without restriction.  Specifically, if other files instantiate
Index: src/vterminate.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/vterminate.cc,v
retrieving revision 1.5
diff -c -p -r1.5 vterminate.cc
*** src/vterminate.cc	1 Apr 2002 21:56:42 -0000	1.5
--- src/vterminate.cc	11 Sep 2002 02:25:08 -0000
***************
*** 2,23 ****
  
  // Copyright (C) 2001, 2002 Free Software Foundation
  //
! // This file is part of GNU CC.
! //
! // GNU CC 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)
  // any later version.
! // 
! // GNU CC 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.
! // 
! // You should have received a copy of the GNU General Public License
! // along with GNU CC; see the file COPYING.  If not, write to
! // the Free Software Foundation, 59 Temple Place - Suite 330,
! // Boston, MA 02111-1307, USA.
  
  // As a special exception, you may use this file as part of a free software
  // library without restriction.  Specifically, if other files instantiate
--- 2,22 ----
  
  // Copyright (C) 2001, 2002 Free Software Foundation
  //
! // 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)
  // 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.
! 
! // 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
! // USA.
  
  // As a special exception, you may use this file as part of a free software
  // library without restriction.  Specifically, if other files instantiate


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]