Commit 4778cba1 authored by Tamar Christina's avatar Tamar Christina

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
parent a5446c45
......@@ -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
......
......@@ -357,6 +357,7 @@ static int totalArgumentSize(char *typeString)
sz += 2;
break;
}
/* fall through */
// everything else is one word.
default:
sz += 1;
......
......@@ -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(
......
......@@ -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)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment