[commit: ghc] wip/tdammers/T11066: Fix 32 bit windows build (7abe373)
git at git.haskell.org
git at git.haskell.org
Wed May 30 10:46:16 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/tdammers/T11066
Link : http://ghc.haskell.org/trac/ghc/changeset/7abe373661d741afa5dce79641a7daf9cb563b3a/ghc
>---------------------------------------------------------------
commit 7abe373661d741afa5dce79641a7daf9cb563b3a
Author: Tamar Christina <tamar at zhox.com>
Date: Mon May 28 19:19:18 2018 +0100
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
>---------------------------------------------------------------
7abe373661d741afa5dce79641a7daf9cb563b3a
libraries/base/System/Environment/ExecutablePath.hsc | 3 ++-
rts/Adjustor.c | 1 +
rts/win32/OSThreads.c | 2 +-
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 448cade..095b25c 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 f2b4355..a1bfeb9 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 cc67353..c67d621 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 a4e5ef6..2d9de52 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)
{
More information about the ghc-commits
mailing list