Permalink
Browse files

Unbreak the build on GHC 7.0.4.

  • Loading branch information...
1 parent 620c2dd commit 3ee0047dd4ac5261a54f87c9ef9496c4c377964c @23Skidoo 23Skidoo committed Feb 9, 2014
Showing with 19 additions and 0 deletions.
  1. +19 −0 cabal-install/Distribution/Client/Compat/ExecutablePath.hs
@@ -35,6 +35,25 @@ import Foreign.Storable
import System.Posix.Internals
#endif
+-- GHC 7.0.* compatibility. 'System.Posix.Internals' in base-4.3.* doesn't
+-- provide 'peekFilePath' and 'peekFilePathLen'.
+#if !MIN_VERSION_base(4,4,0)
+#ifdef mingw32_HOST_OS
+
+peekFilePath :: CWString -> IO FilePath
+peekFilePath = peekCWString
+
+#else
+
+peekFilePath :: CString -> IO FilePath
+peekFilePath = peekCString
+
+peekFilePathLen :: CStringLen -> IO FilePath
+peekFilePathLen = peekCStringLen
+
+#endif
+#endif
+
-- The exported function is defined outside any if-guard to make sure
-- every OS implements it with the same type.

0 comments on commit 3ee0047

Please sign in to comment.