summaryrefslogtreecommitdiffstats
path: root/generic/tclTomMath.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-14 06:08:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-14 06:08:50 (GMT)
commitcfc633e793bcf3f8419aac8b7084c13b2f8dbaa4 (patch)
tree58b484a653058cac3bd24fba45dcc1578ac093c5 /generic/tclTomMath.h
parenta09671a0a00f2d3e4abf4747a072da94b0320459 (diff)
parentf70e1f98b3e5235a48e0fbea21515ed7e277e6cd (diff)
downloadtcl-cfc633e793bcf3f8419aac8b7084c13b2f8dbaa4.zip
tcl-cfc633e793bcf3f8419aac8b7084c13b2f8dbaa4.tar.gz
tcl-cfc633e793bcf3f8419aac8b7084c13b2f8dbaa4.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclTomMath.h')
-rw-r--r--generic/tclTomMath.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h
index 0d2d320..b421cde 100644
--- a/generic/tclTomMath.h
+++ b/generic/tclTomMath.h
@@ -8,7 +8,38 @@
# include "../compat/stdint.h"
# endif
#endif
-#ifndef BN_H_ /* If BN_H_ already defined, don't try to include tommath.h again. */
+#if defined(TCL_NO_TOMMATH_H)
+ typedef size_t mp_digit;
+ typedef int mp_sign;
+# define MP_ZPOS 0 /* positive integer */
+# define MP_NEG 1 /* negative */
+ typedef int mp_ord;
+# define MP_LT -1 /* less than */
+# define MP_EQ 0 /* equal to */
+# define MP_GT 1 /* greater than */
+ typedef int mp_err;
+# define MP_OKAY 0 /* no error */
+# define MP_ERR -1 /* unknown error */
+# define MP_MEM -2 /* out of mem */
+# define MP_VAL -3 /* invalid input */
+# define MP_ITER -4 /* maximum iterations reached */
+# define MP_BUF -5 /* buffer overflow, supplied buffer too small */
+# define MP_WUR /* nothing */
+# define mp_iszero(a) ((a)->used == 0)
+# define mp_isneg(a) ((a)->sign != 0)
+
+ /* the infamous mp_int structure */
+# ifndef MP_INT_DECLARED
+# define MP_INT_DECLARED
+ typedef struct mp_int mp_int;
+# endif
+ struct mp_int {
+ int used, alloc;
+ mp_sign sign;
+ mp_digit *dp;
+};
+
+#elif !defined(BN_H_) /* If BN_H_ already defined, don't try to include tommath.h again. */
# include "tommath.h"
#endif
#include "tclTomMathDecls.h"