summaryrefslogtreecommitdiff
path: root/libraries/base/System/Environment/ExecutablePath.hsc
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/System/Environment/ExecutablePath.hsc')
-rw-r--r--libraries/base/System/Environment/ExecutablePath.hsc3
1 files changed, 2 insertions, 1 deletions
diff --git a/libraries/base/System/Environment/ExecutablePath.hsc b/libraries/base/System/Environment/ExecutablePath.hsc
index 448cade49a..095b25c236 100644
--- a/libraries/base/System/Environment/ExecutablePath.hsc
+++ b/libraries/base/System/Environment/ExecutablePath.hsc
@@ -40,6 +40,7 @@ import Foreign.C
import Foreign.Marshal.Array
import Foreign.Ptr
#include <windows.h>
+#include <stdint.h>
#else
import Foreign.C
import Foreign.Marshal.Alloc
@@ -169,7 +170,7 @@ getExecutablePath = go 2048 -- plenty, PATH_MAX is 512 under Win32
getFinalPath :: FilePath -> IO FilePath
getFinalPath path = withCWString path $ \s ->
bracket (createFile s) c_closeHandle $ \h -> do
- let invalid = h == wordPtrToPtr (#const INVALID_HANDLE_VALUE)
+ let invalid = h == wordPtrToPtr (#const (intptr_t)INVALID_HANDLE_VALUE)
if invalid then pure path else go h bufSize
where go h sz = allocaArray (fromIntegral sz) $ \outPath -> do