Fixes for FreeBSD, including some fairly obvious copy-and-paste errors.

libc++ now mostly works on FreeBSD with libcxxrt and this patch applied to the base system:

http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110920/e666632c/xlocale-0001.obj

Summary of tests on FreeBSD:


****************************************************
Results for /root/libcxx/test:
using FreeBSD clang version 3.0 (trunk 135360) 20110717
Target: x86_64-unknown-freebsd9.0
Thread model: posix
with -std=c++0x -stdlib=libc++ -I/root/libcxx/include -L/root/libcxx/build/lib
----------------------------------------------------
sections without tests   : 1
sections with failures   : 48
sections without failures: 1015
                       +   ----
total number of sections : 1064
----------------------------------------------------
number of tests failed   : 145
number of tests passed   : 4179
                       +   ----
total number of tests    : 4324
****************************************************

(Many due to this clang version not supporting C++ atomics)

More fixes to follow...

llvm-svn: 140245
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 4099aa7..7ae1a34 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -302,24 +302,8 @@
 class _LIBCPP_VISIBLE ctype_base
 {
 public:
-#ifdef __GLIBC__
+#if __GLIBC__
     typedef unsigned short mask;
-#else
-    typedef __uint32_t mask;
-#endif
-
-#if __APPLE__ || __FreeBSD__
-    static const mask space  = _CTYPE_S;
-    static const mask print  = _CTYPE_R;
-    static const mask cntrl  = _CTYPE_C;
-    static const mask upper  = _CTYPE_U;
-    static const mask lower  = _CTYPE_L;
-    static const mask alpha  = _CTYPE_A;
-    static const mask digit  = _CTYPE_D;
-    static const mask punct  = _CTYPE_P;
-    static const mask xdigit = _CTYPE_X;
-    static const mask blank  = _CTYPE_B;
-#else  // __APPLE__
     static const mask space  = _ISspace;
     static const mask print  = _ISprint;
     static const mask cntrl  = _IScntrl;
@@ -330,7 +314,23 @@
     static const mask punct  = _ISpunct;
     static const mask xdigit = _ISxdigit;
     static const mask blank  = _ISblank;
-#endif  // __APPLE__
+#else  // __GLIBC__
+#if __APPLE__
+    typedef __uint32_t mask;
+#elif __FreeBSD__
+    typedef unsigned long mask;
+#endif
+    static const mask space  = _CTYPE_S;
+    static const mask print  = _CTYPE_R;
+    static const mask cntrl  = _CTYPE_C;
+    static const mask upper  = _CTYPE_U;
+    static const mask lower  = _CTYPE_L;
+    static const mask alpha  = _CTYPE_A;
+    static const mask digit  = _CTYPE_D;
+    static const mask punct  = _CTYPE_P;
+    static const mask xdigit = _CTYPE_X;
+    static const mask blank  = _CTYPE_B;
+#endif  // __GLIBC__ 
     static const mask alnum  = alpha | digit;
     static const mask graph  = alnum | punct;