From e037e4a699b527cd77d3e3d54a14ffc89e88ae99 Mon Sep 17 00:00:00 2001
From: ljrittle <ljrittle@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 25 Jan 2005 23:44:03 +0000
Subject: [PATCH] 	* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94236 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libstdc++-v3/ChangeLog                        |  9 +++++
 libstdc++-v3/acinclude.m4                     |  4 +-
 .../config/os/bsd/freebsd/ctype_inline.h      | 39 ++++++++++++++++++-
 libstdc++-v3/configure                        |  6 +--
 4 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a6f79359fcea..c8de690b679b 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,12 @@
+2005-01-25  Loren J. Rittle  <ljrittle@acm.org>
+
+	* 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.
+
 2005-01-25  Benjamin Kosnik  <bkoz@redhat.com>
 
 	* acinclude.m4 (GLIBCXX_ENABLE_C99): Test for complex math
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 2a1c6e2e3320..d7442f1e3845 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1163,7 +1163,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
 
         # ... at some point put __strxfrm_l tests in as well.
         ;;
-      darwin*)
+      darwin* | freebsd*)
         enable_clocale_flag=darwin
 	;;
       *)
@@ -1200,7 +1200,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
       ;;
     darwin)
-      AC_MSG_RESULT(darwin)
+      AC_MSG_RESULT(darwin or freebsd)
 
       CLOCALE_H=config/locale/generic/c_locale.h
       CLOCALE_CC=config/locale/generic/c_locale.cc
diff --git a/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h b/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
index d69324ad5720..37425b65da8e 100644
--- a/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
+++ b/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
+// 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,3 +104,40 @@
 	++__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
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index e2a7f58b4c12..365e2fd3673d 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -5782,7 +5782,7 @@ fi
 
         # ... at some point put __strxfrm_l tests in as well.
         ;;
-      darwin*)
+      darwin* | freebsd*)
         enable_clocale_flag=darwin
 	;;
       *)
@@ -5823,8 +5823,8 @@ echo "${ECHO_T}generic" >&6
       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
       ;;
     darwin)
-      echo "$as_me:$LINENO: result: darwin" >&5
-echo "${ECHO_T}darwin" >&6
+      echo "$as_me:$LINENO: result: darwin or freebsd" >&5
+echo "${ECHO_T}darwin or freebsd" >&6
 
       CLOCALE_H=config/locale/generic/c_locale.h
       CLOCALE_CC=config/locale/generic/c_locale.cc
-- 
GitLab