-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132199 from alexfmpe/cross-mingw-ghc
ghc 8.x: fix cross compilation to windows
- Loading branch information
Showing
3 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c | ||
--- a/rts/win32/OSMem.c | ||
+++ b/rts/win32/OSMem.c | ||
@@ -41,7 +41,7 @@ static block_rec* free_blocks = NULL; | ||
typedef LPVOID(WINAPI *VirtualAllocExNumaProc)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); | ||
|
||
/* Cache NUMA API call. */ | ||
-VirtualAllocExNumaProc VirtualAllocExNuma; | ||
+VirtualAllocExNumaProc _VirtualAllocExNuma; | ||
|
||
void | ||
osMemInit(void) | ||
@@ -52,8 +52,8 @@ osMemInit(void) | ||
/* Resolve and cache VirtualAllocExNuma. */ | ||
if (osNumaAvailable() && RtsFlags.GcFlags.numa) | ||
{ | ||
- VirtualAllocExNuma = (VirtualAllocExNumaProc)GetProcAddress(GetModuleHandleW(L"kernel32"), "VirtualAllocExNuma"); | ||
- if (!VirtualAllocExNuma) | ||
+ _VirtualAllocExNuma = (VirtualAllocExNumaProc)(void*)GetProcAddress(GetModuleHandleW(L"kernel32"), "VirtualAllocExNuma"); | ||
+ if (!_VirtualAllocExNuma) | ||
{ | ||
sysErrorBelch( | ||
"osBindMBlocksToNode: VirtualAllocExNuma does not exist. How did you get this far?"); | ||
@@ -569,7 +569,7 @@ void osBindMBlocksToNode( | ||
On windows also -xb is broken, it does nothing so that can't | ||
be used to tweak it (see #12577). So for now, just let the OS decide. | ||
*/ | ||
- temp = VirtualAllocExNuma( | ||
+ temp = _VirtualAllocExNuma( | ||
GetCurrentProcess(), | ||
NULL, // addr? See base memory | ||
size, |