Skip to content

Commit 5d328cb

Browse files
committed
windows: mingw32 gcc doesn't define endianness macros, so just assume little.
Specifically, at least Ubuntu's i586-mingw32msvc-gcc doesn't supply __LITTLE_ENDIAN__ and friends. And as it's safe enough to assume that Windows is only little-endian, then it's defined unconditionally, instead of duplicating detection logic in py/mpconfig.h (or adding windows-specific defines to it).
1 parent 5dc8f9b commit 5d328cb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

windows/mpconfigport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ typedef unsigned int mp_uint_t; // must be pointer size
8888

8989
#define BYTES_PER_WORD sizeof(mp_int_t)
9090

91+
// Just assume Windows is little-endian - mingw32 gcc doesn't
92+
// define standard endianness macros.
93+
#define MP_ENDIANNESS_LITTLE (1)
94+
9195
typedef void *machine_ptr_t; // must be of pointer size
9296
typedef const void *machine_const_ptr_t; // must be of pointer size
9397

0 commit comments

Comments
 (0)