[PATCH] Fix endian handling w.r.t. CPP macro WORDS_BIGENDIAN
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Mon, 9 Dec 2019 14:41:57 +0000 (15:41 +0100)
committerIlias Tsitsimpis <iliastsi@debian.org>
Tue, 11 Aug 2020 14:12:43 +0000 (15:12 +0100)
Include header file `ghcautoconf.h` where the CPP macro
`WORDS_BIGENDIAN` is defined. This finally fixes #17337 (in conjunction
with commit 6c59cc71dc).

Gbp-Pq: Name 3c12355ece0fa14e534c71a9f7327eda9773fad9.patch

libraries/base/GHC/ByteOrder.hs
libraries/base/GHC/IO/Encoding/CodePage/API.hs

index 8a42e8df71eeca3e4cfa6518f8b02529dbfad228..9b647ceb1f452e5b38f3eeb30af10be0f23d45c8 100644 (file)
@@ -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.
index b31ebe96f5d840b5b8b62d1a77a1abddf64edbb2..bf73f07a24c9f66770f1ced881f3edb04d1bd06e 100644 (file)
@@ -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