diff options
author | Tamar Christina <tamar@zhox.com> | 2018-05-28 19:19:18 +0100 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2018-05-28 19:29:44 +0100 |
commit | 4778cba1dbb6adf495930322d7f9e9db0af60d8f (patch) | |
tree | 2b8180103d3699eb9ec2aa8450cb8501e7b2d06f | |
parent | a5446c4501cf30aa06eab636823d031bb98db739 (diff) | |
download | haskell-4778cba1dbb6adf495930322d7f9e9db0af60d8f.tar.gz |
Fix 32 bit windows build
Summary:
Fix a number of issues that have broken the 32 bit build.
This makes it build again.
Test Plan: ./validate
Reviewers: hvr, goldfire, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4691
-rw-r--r-- | libraries/base/System/Environment/ExecutablePath.hsc | 3 | ||||
-rw-r--r-- | rts/Adjustor.c | 1 | ||||
-rw-r--r-- | rts/win32/OSThreads.c | 2 | ||||
-rw-r--r-- | rts/win32/veh_excn.c | 2 |
4 files changed, 5 insertions, 3 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 diff --git a/rts/Adjustor.c b/rts/Adjustor.c index f2b4355831..a1bfeb96b7 100644 --- a/rts/Adjustor.c +++ b/rts/Adjustor.c @@ -357,6 +357,7 @@ static int totalArgumentSize(char *typeString) sz += 2; break; } + /* fall through */ // everything else is one word. default: sz += 1; diff --git a/rts/win32/OSThreads.c b/rts/win32/OSThreads.c index cc673532d7..c67d621bc2 100644 --- a/rts/win32/OSThreads.c +++ b/rts/win32/OSThreads.c @@ -578,7 +578,7 @@ void setThreadNode (uint32_t node) { if (osNumaAvailable()) { - StgWord mask = 0; + uint64_t mask = 0; if (!GetNumaNodeProcessorMask(node, &mask) && !SetThreadAffinityMask(GetCurrentThread(), mask)) { sysErrorBelch( diff --git a/rts/win32/veh_excn.c b/rts/win32/veh_excn.c index a4e5ef68c5..2d9de52199 100644 --- a/rts/win32/veh_excn.c +++ b/rts/win32/veh_excn.c @@ -314,7 +314,7 @@ void generateStack (EXCEPTION_POINTERS* pExceptionPointers) fprintf (stderr, " * 0x%" PRIxPTR "\t%ls\n", (uintptr_t)stackFrame.AddrFrame.Offset, resolveSymbolAddr ((wchar_t*)&buffer, 1024, - (SymbolAddr*)stackFrame.AddrPC.Offset, + (SymbolAddr*)(intptr_t)stackFrame.AddrPC.Offset, &topSp)); if (lastBp >= stackFrame.AddrFrame.Offset) { |