This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

PATCH (libstdc++-v3): Override generic ctype<wchar_t> for FreeBSD5


In article <200501250151.j0P1pvfF008592@latour.waar.labs.mot.com>,
Loren James Rittle <rittle@latour.waar.labs.mot.com> writes:

> I will install a Drawin-style non-ABI breaking fix for FreeBSD on
> mainline.  I will move it to the 3_4 branch.

Done (for mainline only since not a regression).  I thought a while
about this and conclude that mirroring the file would make more future
work.  Fixes two port FAILs.  As installed, after required protocol
(on i386-unknown-freebsd5.3).  Only two strange FAILs left to fix on mainline.

	* acinclude.m4 (GLIBCXX_ENABLE_CLOCALE): Map FreeBSD to darwin
	instead of generic.  Change autoconf report to "darwin or freebsd".
	* configure: Regenerate.
	* config/os/bsd/freebsd/ctype_inline.h (ctype<wchar_t>::do_is): Add.
	(ctype<wchar_t>::do_scan_is): Likewise.
	(ctype<wchar_t>::do_scan_not): Likewise.

Index: libstdc++-v3/acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.304
diff -c -r1.304 acinclude.m4
*** libstdc++-v3/acinclude.m4	25 Jan 2005 15:46:10 -0000	1.304
--- libstdc++-v3/acinclude.m4	25 Jan 2005 23:22:39 -0000
***************
*** 1163,1169 ****
  
          # ... at some point put __strxfrm_l tests in as well.
          ;;
!       darwin*)
          enable_clocale_flag=darwin
  	;;
        *)
--- 1163,1169 ----
  
          # ... at some point put __strxfrm_l tests in as well.
          ;;
!       darwin* | freebsd*)
          enable_clocale_flag=darwin
  	;;
        *)
***************
*** 1200,1206 ****
        CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
        ;;
      darwin)
!       AC_MSG_RESULT(darwin)
  
        CLOCALE_H=config/locale/generic/c_locale.h
        CLOCALE_CC=config/locale/generic/c_locale.cc
--- 1200,1206 ----
        CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
        ;;
      darwin)
!       AC_MSG_RESULT(darwin or freebsd)
  
        CLOCALE_H=config/locale/generic/c_locale.h
        CLOCALE_CC=config/locale/generic/c_locale.cc
Index: libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h,v
retrieving revision 1.2
diff -c -r1.2 ctype_inline.h
*** libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h	11 Mar 2003 07:07:25 -0000	1.2
--- libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h	25 Jan 2005 23:22:40 -0000
***************
*** 1,6 ****
  // Locale support -*- C++ -*-
  
! // Copyright (C) 2000, 2003 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 -*- C++ -*-
  
! // Copyright (C) 2000, 2003, 2004, 2005 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
***************
*** 104,106 ****
--- 104,143 ----
  	++__low;
      return __low;
    }
+ 
+ #ifdef _GLIBCXX_USE_WCHAR_T  
+   inline bool
+   ctype<wchar_t>::
+   do_is(mask __m, wchar_t __c) const
+   {
+     return __istype (__c, __m);
+   }
+ 
+   inline const wchar_t* 
+   ctype<wchar_t>::
+   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
+   {
+     for (; __lo < __hi; ++__vec, ++__lo)
+       *__vec = __maskrune (*__lo, upper | lower | alpha | digit | xdigit
+ 			   | space | print | graph | cntrl | punct | alnum);
+     return __hi;
+   }
+   
+   inline const wchar_t* 
+   ctype<wchar_t>::
+   do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
+   {
+     while (__lo < __hi && ! __istype (*__lo, __m))
+       ++__lo;
+     return __lo;
+   }
+ 
+   inline const wchar_t*
+   ctype<wchar_t>::
+   do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+   {
+     while (__lo < __hi && __istype (*__lo, __m))
+       ++__lo;
+     return __lo;
+   }
+ #endif


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