From 2da81fa80c4cd965f05ad237d81d9764322fde20 Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Fri, 11 Apr 2014 03:44:00 +0300
Subject: [PATCH] mpconfig.h: Add basic support for target endianness
 configuration.

A specific target can define either MP_ENDIANNESS_LITTLE or MP_ENDIANNESS_BIG
to 1. Default is MP_ENDIANNESS_LITTLE.

TODO: Autodetect based on compiler predefined macros?
---
 py/mpconfig.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/py/mpconfig.h b/py/mpconfig.h
index b120c4bb4..2c118b4bb 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -169,6 +169,11 @@ typedef double mp_float_t;
 // machine_int_t value with most significant bit set
 #define WORD_MSBIT_HIGH (((machine_uint_t)1) << (BYTES_PER_WORD * 8 - 1))
 
+#if !defined(MP_ENDIANNESS_LITTLE) && !defined(MP_ENDIANNESS_BIG)
+// Just because most archs are such?
+#define MP_ENDIANNESS_LITTLE (1)
+#endif
+
 // printf format spec to use for machine_int_t and friends
 #ifndef INT_FMT
 #ifdef __LP64__
-- 
GitLab