add Data.Sequence to nhc98 build
[haskell-directory.git] / Foreign / C / String.hs
index b03d32b..8a23c6b 100644 (file)
@@ -1,4 +1,4 @@
-{-# OPTIONS -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -fno-implicit-prelude #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Foreign.C.String
@@ -168,10 +168,8 @@ newCStringLen = newCAStringLen
 withCString :: String -> (CString -> IO a) -> IO a
 withCString = withCAString
 
--- | Marshal a Haskell string into a NUL terminated C string using temporary
--- storage.
---
--- * the Haskell string may /not/ contain any NUL characters
+-- | Marshal a Haskell string into a C string (ie, character array)
+-- in temporary storage, with explicit length information.
 --
 -- * the memory is freed when the subcomputation terminates (either
 --   normally or via an exception), so the pointer to the temporary
@@ -309,10 +307,8 @@ withCAString str f =
       f ptr
 #endif
 
--- | Marshal a Haskell string into a NUL terminated C string using temporary
--- storage.
---
--- * the Haskell string may /not/ contain any NUL characters
+-- | Marshal a Haskell string into a C string (ie, character array)
+-- in temporary storage, with explicit length information.
 --
 -- * the memory is freed when the subcomputation terminates (either
 --   normally or via an exception), so the pointer to the temporary
@@ -444,7 +440,7 @@ wNUL = 0
 cWcharsToChars :: [CWchar] -> [Char]
 charsToCWchars :: [Char] -> [CWchar]
 
-#ifdef mingw32_TARGET_OS
+#ifdef mingw32_HOST_OS
 
 -- On Windows, wchar_t is 16 bits wide and CWString uses the UTF-16 encoding.
 
@@ -465,7 +461,7 @@ charsToCWchars = foldr utf16Char [] . map ord
                     fromIntegral (c' `div` 0x400 + 0xd800) :
                     fromIntegral (c' `mod` 0x400 + 0xdc00) : wcs
 
-#else /* !mingw32_TARGET_OS */
+#else /* !mingw32_HOST_OS */
 
 cWcharsToChars xs  = map castCWcharToChar xs
 charsToCWchars xs  = map castCharToCWchar xs
@@ -479,4 +475,4 @@ castCWcharToChar ch = chr (fromIntegral ch )
 castCharToCWchar :: Char -> CWchar
 castCharToCWchar ch = fromIntegral (ord ch)
 
-#endif /* !mingw32_TARGET_OS */
+#endif /* !mingw32_HOST_OS */