summaryrefslogtreecommitdiff
path: root/rts/win32/OSThreads.c
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2017-05-11 18:14:26 +0800
committerMoritz Angermann <moritz.angermann@gmail.com>2017-05-11 18:31:44 +0800
commitb5ca082d297bc6306f445cb672a07b907dff8b18 (patch)
tree8bf02720f75953e97a84dc7ad27b79c55bbf12fd /rts/win32/OSThreads.c
parent83dcaa8c1e25e5d73c0010029ade30713c0e1696 (diff)
downloadhaskell-b5ca082d297bc6306f445cb672a07b907dff8b18.tar.gz
We define the `<XXX>_HOST_ARCH` to `1`, but never to `0`in
compiler/ghc.mk @echo "#define $(HostArch_CPP)_HOST_ARCH 1" >> $@ @echo "#define $(TargetArch_CPP)_HOST_ARCH 1" >> $@ this leads to warnigns like: > warning: 'x86_64_HOST_ARCH' is not defined, evaluates to 0 [-Wundef] Reviewers: austin, bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3555
Diffstat (limited to 'rts/win32/OSThreads.c')
-rw-r--r--rts/win32/OSThreads.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/rts/win32/OSThreads.c b/rts/win32/OSThreads.c
index 4deb14a5f4..ad4234066b 100644
--- a/rts/win32/OSThreads.c
+++ b/rts/win32/OSThreads.c
@@ -251,7 +251,7 @@ forkOS_createThread ( HsStablePtr entry )
(unsigned*)&pId) == 0);
}
-#if x86_64_HOST_ARCH
+#if defined(x86_64_HOST_ARCH)
/* We still support Windows Vista, so we can't depend on it
and must manually resolve these. */
typedef DWORD(WINAPI *GetItemCountProc)(WORD);
@@ -306,7 +306,7 @@ getNumberOfProcessorsGroups (void)
static uint8_t n_groups = 0;
-#if x86_64_HOST_ARCH
+#if defined(x86_64_HOST_ARCH)
if (!n_groups)
{
/* We still support Windows Vista. Which means we can't rely
@@ -328,7 +328,7 @@ getNumberOfProcessorsGroups (void)
return n_groups;
}
-#if x86_64_HOST_ARCH
+#if defined(x86_64_HOST_ARCH)
static uint8_t*
getProcessorsDistribution (void)
{
@@ -377,7 +377,7 @@ getProcessorsCumulativeSum(void)
cpuGroupCumulativeCache = malloc(n_groups * sizeof(uint32_t));
memset(cpuGroupCumulativeCache, 0, n_groups * sizeof(uint32_t));
-#if x86_64_HOST_ARCH
+#if defined(x86_64_HOST_ARCH)
uint8_t* proc_dist = getProcessorsDistribution();
uint32_t cum_num_proc = 0;
for (int i = 0; i < n_groups; i++)
@@ -419,7 +419,7 @@ createProcessorGroupMap (void)
/* For 32bit Windows and 64bit older than Windows 7, create a default mapping. */
memset(cpuGroupCache, 0, numProcs * sizeof(uint8_t));
-#if x86_64_HOST_ARCH
+#if defined(x86_64_HOST_ARCH)
uint8_t* proc_dist = getProcessorsDistribution();
int totalProcs = 0;
@@ -443,7 +443,7 @@ getNumberOfProcessors (void)
{
static uint32_t nproc = 0;
-#if x86_64_HOST_ARCH
+#if defined(x86_64_HOST_ARCH)
/* We still support Windows Vista. Which means we can't rely
on the API being available. So we'll have to resolve manually. */
HMODULE kernel = GetModuleHandleW(L"kernel32");
@@ -510,7 +510,7 @@ setThreadAffinity (uint32_t n, uint32_t m) // cap N of M
mask[group] |= 1 << ix;
}
-#if x86_64_HOST_ARCH
+#if defined(x86_64_HOST_ARCH)
/* We still support Windows Vista. Which means we can't rely
on the API being available. So we'll have to resolve manually. */
HMODULE kernel = GetModuleHandleW(L"kernel32");
@@ -520,7 +520,7 @@ setThreadAffinity (uint32_t n, uint32_t m) // cap N of M
for (i = 0; i < n_groups; i++)
{
-#if x86_64_HOST_ARCH
+#if defined(x86_64_HOST_ARCH)
// If we support the new API, use it.
if (mask[i] > 0 && SetThreadGroupAffinity)
{