utf8-light for GHC 7.8

This commit is contained in:
Michael Snoyman 2013-10-15 09:40:57 +03:00
parent d8dec4f827
commit 48f5629dd8

View File

@ -0,0 +1,43 @@
diff -ru orig/src/Codec/Binary/UTF8/Light.hs new/src/Codec/Binary/UTF8/Light.hs
--- orig/src/Codec/Binary/UTF8/Light.hs 2013-10-15 09:40:45.447493856 +0300
+++ new/src/Codec/Binary/UTF8/Light.hs 2013-10-15 09:40:45.000000000 +0300
@@ -251,15 +251,27 @@
-- can use Word# literalls
-- ==> 0xff00ff00##
encodeUTF8' ((W32# w):xs)
+#if MIN_VERSION_base(4,7,0)
+ | I# (w`ltWord#`(int2Word# 0x80#)) /= 0 =
+#else
| w`ltWord#`(int2Word# 0x80#) =
+#endif
[W8# w] : encodeUTF8' xs
+#if MIN_VERSION_base(4,7,0)
+ | I# (w`ltWord#`(int2Word# 0x800#)) /= 0 =
+#else
| w`ltWord#`(int2Word# 0x800#) =
+#endif
[ W8#(w`uncheckedShiftRL#`6#
`or#`(int2Word# 0xc0#))
, W8#(w`and#`(int2Word# 0x3f#)
`or#`(int2Word# 0x80#))
] : encodeUTF8' xs
+#if MIN_VERSION_base(4,7,0)
+ | I# (w`ltWord#`(int2Word# 0xf0000#)) /= 0 =
+#else
| w`ltWord#`(int2Word# 0xf0000#) =
+#endif
[ W8#(w`uncheckedShiftRL#`12#
`or#`(int2Word# 0xe0#))
, W8#(w`uncheckedShiftRL#`6#
@@ -268,7 +280,11 @@
, W8#(w`and#`(int2Word# 0x3f#)
`or#`(int2Word# 0x80#))
] : encodeUTF8' xs
+#if MIN_VERSION_base(4,7,0)
+ | I# (w`ltWord#`(int2Word# 0xe00000#)) /= 0 =
+#else
| w`ltWord#`(int2Word# 0xe00000#) =
+#endif
[ W8#(w`uncheckedShiftRL#`18#
`or#`(int2Word# 0xf0#))
, W8#(w`uncheckedShiftRL#`12#