Commit a3076677bebf421cfd8fb378dcda7f9e743a2e43

nijtmans 2019-03-28T16:18:41

previous commit removed a little bit too much

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/tommath.h b/tommath.h
index e5cee9b..692433b 100644
--- a/tommath.h
+++ b/tommath.h
@@ -93,6 +93,11 @@ typedef uint64_t             mp_word;
 #   endif
 #endif
 
+/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
+#ifndef DIGIT_BIT
+#   define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1))  /* bits per digit */
+#endif
+
 #define MP_DIGIT_BIT     DIGIT_BIT
 #define MP_MASK          ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
 #define MP_DIGIT_MAX     MP_MASK