Fix test build in GHC 6.10.
diff --git a/tests/EnumeratorTests/Text/Handle.hs b/tests/EnumeratorTests/Text/Handle.hs
index 8a341c3..a612a65 100644
--- a/tests/EnumeratorTests/Text/Handle.hs
+++ b/tests/EnumeratorTests/Text/Handle.hs
@@ -26,10 +26,10 @@
 import qualified Data.Enumerator.List as EL
 import qualified Data.Enumerator.Text as ET
 
-#ifdef MIN_VERSION_knob
-
 import           Paths_enumerator_tests (getDataFileName)
 
+#ifdef MIN_VERSION_knob
+
 test_EnumHandle :: Suite
 test_EnumHandle = assertions "enumHandle" $ do
 	do
@@ -89,6 +89,23 @@
 	, "\2997\2979\2965\3021\2965\2990\3021\r\n"
 	]
 
+-- define locally, because it's not present in GHC 6.10
+data Newline = LF | CRLF
+	deriving (Show, Eq)
+
+nativeNewline :: Newline
+#if MIN_VERSION_base(4,2,0)
+nativeNewline = case IO.nativeNewline of
+	IO.LF -> LF
+	IO.CRLF -> CRLF
+#else
+#ifdef CABAL_OS_WINDOWS
+nativeNewline = CRLF
+#else
+nativeNewline = LF
+#endif
+#endif
+
 test_EnumFile :: Suite
 test_EnumFile = assertions "enumFile" $ do
 	do
@@ -98,6 +115,6 @@
 	do
 		path <- liftIO (getDataFileName "data/utf8-crlf.txt")
 		chunks <- liftIO (E.run_ (ET.enumFile path $$ EL.consume))
-		$expect (equal chunks (case IO.nativeNewline of
-			IO.LF -> lines_CRLF
-			IO.CRLF -> lines_LF))
+		$expect (equal chunks (case nativeNewline of
+			LF -> lines_CRLF
+			CRLF -> lines_LF))
diff --git a/tests/enumerator-tests.cabal b/tests/enumerator-tests.cabal
index 63d5665..eee50d1 100644
--- a/tests/enumerator-tests.cabal
+++ b/tests/enumerator-tests.cabal
@@ -34,6 +34,9 @@
     build-depends:
         base >= 4.0 && < 5.0
 
+  if os(windows)
+    cpp-options: -DCABAL_OS_WINDOWS
+
   build-depends:
       bytestring
     , chell >= 0.2 && < 0.3