Wolfgang Jeltsch pushed to branch wip/jeltsch/portable-bco-byte-array-serialization at Glasgow Haskell Compiler / GHC
Commits:
-
fce533d8
by Wolfgang Jeltsch at 2026-11-26T17:26:05+02:00
1 changed file:
Changes:
| ... | ... | @@ -46,7 +46,7 @@ import Control.Monad (replicateM) |
| 46 | 46 | #endif
|
| 47 | 47 | |
| 48 | 48 | isLittleEndian :: Bool
|
| 49 | -#if defined(WORDS_BIGENDIAN)
|
|
| 49 | +#ifdef WORDS_BIGENDIAN
|
|
| 50 | 50 | isLittleEndian = False
|
| 51 | 51 | #else
|
| 52 | 52 | isLittleEndian = True
|
| ... | ... | @@ -183,7 +183,7 @@ getBCOByteArrayPortably getElement = do |
| 183 | 183 | |
| 184 | 184 | #endif
|
| 185 | 185 | |
| 186 | -#if !defined(WORDS_BIGENDIAN)
|
|
| 186 | +#ifndef WORDS_BIGENDIAN
|
|
| 187 | 187 | |
| 188 | 188 | -- | Serialize a 'BCOByteArray', writing the payload verbatim instead of
|
| 189 | 189 | -- serializing the individual elements. This must only be used when the host
|
| ... | ... | @@ -214,7 +214,7 @@ getBCOByteArrayDirectly @a = do |
| 214 | 214 | -- See Note [BCOByteArray serialization].
|
| 215 | 215 | instance Binary (BCOByteArray Word16) where
|
| 216 | 216 | |
| 217 | -#if defined(WORDS_BIGENDIAN)
|
|
| 217 | +#ifdef WORDS_BIGENDIAN
|
|
| 218 | 218 | put = putBCOByteArrayPortably putWord16le
|
| 219 | 219 | get = getBCOByteArrayPortably getWord16le
|
| 220 | 220 | #else
|