Win32 2.2.0.1 → 2.2.0.2
raw patch · 2 files changed
+9/−4 lines, 2 files
Files
- System/Win32/Types.hs +8/−3
- Win32.cabal +1/−1
System/Win32/Types.hs view
@@ -23,6 +23,7 @@ import Control.Exception import System.IO.Error import Data.Char+import Numeric (showHex) ---------------------------------------------------------------- -- Platform specific definitions@@ -204,9 +205,12 @@ failWith :: String -> ErrCode -> IO a failWith fn_name err_code = do c_msg <- getErrorMessage err_code- msg <- peekTString c_msg- -- We ignore failure of freeing c_msg, given we're already failing- _ <- localFree c_msg+ msg <- if c_msg == nullPtr+ then return $ "Error 0x" ++ Numeric.showHex err_code ""+ else do msg <- peekTString c_msg+ -- We ignore failure of freeing c_msg, given we're already failing+ _ <- localFree c_msg+ return msg c_maperrno -- turn GetLastError() into errno, which errnoToIOError knows -- how to convert to an IOException we can throw. -- XXX we should really do this directly.@@ -215,6 +219,7 @@ ioerror = errnoToIOError fn_name errno Nothing Nothing `ioeSetErrorString` msg' throw ioerror+ foreign import ccall unsafe "maperrno" -- in base/cbits/Win32Utils.c c_maperrno :: IO ()
Win32.cabal view
@@ -1,5 +1,5 @@ name: Win32-version: 2.2.0.1+version: 2.2.0.2 license: BSD3 license-file: LICENSE author: Alastair Reid