import Foreign.Marshal.Alloc ( allocaBytes )
import System.IO (IOMode(..), openBinaryFile, hGetBuf, hPutBuf, hClose)
import System.IO.Error ( try )
-import GHC.IOBase ( IOException(..), IOErrorType(..) )
+import GHC.IOBase ( IOException(..) )
+#if defined(mingw32_HOST_OS)
+import GHC.IOBase ( IOErrorType(..) )
+#endif
#else
import System.IO ( try )
#endif
#if __GLASGOW_HASKELL__ && defined(mingw32_HOST_OS)
-import Foreign.Ptr
+import Foreign
import Foreign.C
#endif
import System.Directory(doesFileExist, doesDirectoryExist, getPermissions, setPermissions, createDirectory)