summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonatan Goldschmidt <yon.goldschmidt@gmail.com>2019-12-01 01:10:12 +0200
committerYonatan Goldschmidt <yon.goldschmidt@gmail.com>2020-01-12 20:57:01 +0200
commit1c849d63a86782f006b73a9d570d542cfd18538e (patch)
treea4b81438f440090d61467d47dfa44732a59475dd
parent40057600b873b2a802de332d251492a762b32011 (diff)
py/mpconfig.h: Define BITS_PER_BYTE only if not already defined.
It's a common macro that is possibly defined in headers of systems/SDKs MicroPython is embedded into.
-rw-r--r--py/mpconfig.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 5601cc2f7..8e06153a8 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1468,7 +1468,9 @@ typedef double mp_float_t;
#define BYTES_PER_WORD (sizeof(mp_uint_t))
#endif
+#ifndef BITS_PER_BYTE
#define BITS_PER_BYTE (8)
+#endif
#define BITS_PER_WORD (BITS_PER_BYTE * BYTES_PER_WORD)
// mp_int_t value with most significant bit set
#define WORD_MSBIT_HIGH (((mp_uint_t)1) << (BYTES_PER_WORD * 8 - 1))