diff options
author | Stefan Schulze Frielinghaus <stefansf@linux.ibm.com> | 2019-12-09 15:41:57 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-24 01:03:44 -0500 |
commit | 3c12355ece0fa14e534c71a9f7327eda9773fad9 (patch) | |
tree | 9e3f9de932d5761e78aedf52b958d9a817fb1efa | |
parent | 70e56b272492b65e41a149ec39a939e794fea66b (diff) | |
download | haskell-3c12355ece0fa14e534c71a9f7327eda9773fad9.tar.gz |
Fix endian handling w.r.t. CPP macro WORDS_BIGENDIAN
Include header file `ghcautoconf.h` where the CPP macro
`WORDS_BIGENDIAN` is defined. This finally fixes #17337 (in conjunction
with commit 6c59cc71dc).
-rw-r--r-- | libraries/base/GHC/ByteOrder.hs | 3 | ||||
-rw-r--r-- | libraries/base/GHC/IO/Encoding/CodePage/API.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_run/T7600.hs | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/libraries/base/GHC/ByteOrder.hs b/libraries/base/GHC/ByteOrder.hs index 8a42e8df71..9b647ceb1f 100644 --- a/libraries/base/GHC/ByteOrder.hs +++ b/libraries/base/GHC/ByteOrder.hs @@ -17,6 +17,9 @@ module GHC.ByteOrder where +-- Required for WORDS_BIGENDIAN +#include "ghcautoconf.h" + -- | Byte ordering. data ByteOrder = BigEndian -- ^ most-significant-byte occurs in lowest address. diff --git a/libraries/base/GHC/IO/Encoding/CodePage/API.hs b/libraries/base/GHC/IO/Encoding/CodePage/API.hs index b31ebe96f5..bf73f07a24 100644 --- a/libraries/base/GHC/IO/Encoding/CodePage/API.hs +++ b/libraries/base/GHC/IO/Encoding/CodePage/API.hs @@ -7,6 +7,9 @@ module GHC.IO.Encoding.CodePage.API ( mkCodePageEncoding ) where +-- Required for WORDS_BIGENDIAN +#include "ghcautoconf.h" + import Foreign.C import Foreign.Ptr import Foreign.Marshal diff --git a/testsuite/tests/codeGen/should_run/T7600.hs b/testsuite/tests/codeGen/should_run/T7600.hs index 4193fdc33f..a544b8bd70 100644 --- a/testsuite/tests/codeGen/should_run/T7600.hs +++ b/testsuite/tests/codeGen/should_run/T7600.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} -- !!! Bug # 7600. -- The LLVM backend can be tricky to get right with floating point constants -- and GHC. See Note [LLVM Float Types] in compiler/llvmGen/Llvm/Types.hs for @@ -16,6 +17,9 @@ -- Also worth looking at ticket # 3676 about issues with 'realToFrac'. module Main (main) where +-- Required for WORDS_BIGENDIAN +#include "ghcautoconf.h" + import T7600_A -- a fp constant that requires double precision, but we only use a single |