fix for GHC >= 6.5 again
[ghc-hetmet.git] / ghc / lib / compat / Compat / Unicode.hs
index 4765511..2637fac 100644 (file)
@@ -1,11 +1,11 @@
 {-# OPTIONS -cpp #-}
 module Compat.Unicode (
-    GeneralCategory(..), generalCategory,
+    GeneralCategory(..), generalCategory, isPrint, isUpper
   ) where
 
 #if __GLASGOW_HASKELL__ > 604
 
-import Data.Char (GeneralCategory(..), generalCategory)
+import Data.Char (GeneralCategory(..), generalCategory,isPrint,isUpper)
 
 #else
 
@@ -54,4 +54,13 @@ generalCategory c = toEnum (wgencat (fromIntegral (ord c)))
 
 foreign import ccall unsafe "u_gencat"
   wgencat :: CInt -> Int
+
+isPrint c = iswprint (fromIntegral (ord c)) /= 0
+isUpper c = iswupper (fromIntegral (ord c)) /= 0
+
+foreign import ccall unsafe "u_iswprint"
+  iswprint :: CInt -> CInt
+
+foreign import ccall unsafe "u_iswupper"
+  iswupper :: CInt -> CInt
 #endif