diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2017-05-11 18:14:26 +0800 |
---|---|---|
committer | Moritz Angermann <moritz.angermann@gmail.com> | 2017-05-11 18:31:44 +0800 |
commit | b5ca082d297bc6306f445cb672a07b907dff8b18 (patch) | |
tree | 8bf02720f75953e97a84dc7ad27b79c55bbf12fd /rts | |
parent | 83dcaa8c1e25e5d73c0010029ade30713c0e1696 (diff) | |
download | haskell-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')
-rw-r--r-- | rts/linker/MachOTypes.h | 7 | ||||
-rw-r--r-- | rts/sm/HeapAlloc.h | 2 | ||||
-rw-r--r-- | rts/win32/OSThreads.c | 16 |
3 files changed, 13 insertions, 12 deletions
diff --git a/rts/linker/MachOTypes.h b/rts/linker/MachOTypes.h index 7d9d64cbce..4176c4890f 100644 --- a/rts/linker/MachOTypes.h +++ b/rts/linker/MachOTypes.h @@ -6,13 +6,14 @@ #include <mach-o/loader.h> -#if x86_64_HOST_ARCH || powerpc64_HOST_ARCH \ - || aarch64_HOST_ARCH || arm64_HOST_ARCH +#if defined(x86_64_HOST_ARCH) || defined(powerpc64_HOST_ARCH) \ + || defined(aarch64_HOST_ARCH) || defined(arm64_HOST_ARCH) typedef struct mach_header_64 MachOHeader; typedef struct segment_command_64 MachOSegmentCommand; typedef struct section_64 MachOSection; typedef struct nlist_64 MachONList; -#elif i386_HOST_ARCH || powerpc_HOST_ARCH || arm_HOST_ARCH +#elif defined(i386_HOST_ARCH) || defined(powerpc_HOST_ARCH) \ + || defined(arm_HOST_ARCH) typedef struct mach_header MachOHeader; typedef struct segment_command MachOSegmentCommand; typedef struct section MachOSection; diff --git a/rts/sm/HeapAlloc.h b/rts/sm/HeapAlloc.h index 9a36d106bb..197317f6fa 100644 --- a/rts/sm/HeapAlloc.h +++ b/rts/sm/HeapAlloc.h @@ -130,7 +130,7 @@ extern StgWord8 mblock_map[]; #define MBC_LINE_BITS 0 #define MBC_TAG_BITS 15 -#if x86_64_HOST_ARCH +#if defined(x86_64_HOST_ARCH) // 32bits are enough for 'entry' as modern amd64 boxes have // only 48bit sized virtual addres. typedef StgWord32 MbcCacheLine; 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) { |