diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a6f79359fcea898b10cbecf7c242524f7b0e4cc3..c8de690b679b14871e65850c14f4543d3dbb7f1e 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 2a1c6e2e3320c2f077a931397f1a3db573db496b..d7442f1e384553b775cfdb0ad516134825248e45 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 d69324ad572039e96c538d0b8a11580f0d6626a2..37425b65da8e2510434dec8ac32a5b2137994662 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 e2a7f58b4c12b9d66edb87071277b01375e5d870..365e2fd3673ddfadbe0a959991acfc1bc25260bb 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