Mercurial > cpython-lru_cache-weakref
diff Modules/_sha3/sha3module.c @ 79803:d2127cdec10e
Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unified
endianess detection and handling.
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Wed, 17 Oct 2012 23:52:17 +0200 |
| parents | 40a1652349e9 |
| children | 4b42d7f288c5 |
line wrap: on
line diff
--- a/Modules/_sha3/sha3module.c Wed Oct 17 17:33:26 2012 +0300 +++ b/Modules/_sha3/sha3module.c Wed Oct 17 23:52:17 2012 +0200 @@ -124,11 +124,14 @@ #define UseInterleaveTables #endif -/* replacement for brg_endian.h -#define IS_BIG_ENDIAN BIG_ENDIAN -#define IS_LITTLE_ENDIAN LITTLE_ENDIAN -#define PLATFORM_BYTE_ORDER BYTE_ORDER -*/ +/* replacement for brg_endian.h */ +#define IS_BIG_ENDIAN 4321 +#define IS_LITTLE_ENDIAN 1234 +#if PY_BIG_ENDIAN +# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN +#else +# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN +#endif /* inline all Keccak dependencies */ #include "keccak/KeccakNISTInterface.h"
