summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2019-12-09 15:41:57 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-12-24 01:03:44 -0500
commit3c12355ece0fa14e534c71a9f7327eda9773fad9 (patch)
tree9e3f9de932d5761e78aedf52b958d9a817fb1efa /libraries/base
parent70e56b272492b65e41a149ec39a939e794fea66b (diff)
downloadhaskell-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).
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/GHC/ByteOrder.hs3
-rw-r--r--libraries/base/GHC/IO/Encoding/CodePage/API.hs3
2 files changed, 6 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