Tcl Source Code

View Ticket
Login
Ticket UUID: 2a5cb49733ffc8314a841c88c7e84040c29651f1
Title: Make TCL_NO_TOMMATH_H sufficient for tclTomMathDecls.h
Type: Patch Version: core-8-branch
Submitter: chrstphrchvz Created on: 2023-04-22 12:41:50
Subsystem: 56. LibTomMath Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-04-22 17:46:14
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2023-04-22 17:46:14
Description:

As an alternative solution for [ff255adc4cb5], I tried defining TCL_NO_TOMMATH_H (from [1baf516ed4f1]), but tclTomMathDecls.h still needs mp_order, mp_endian, and MP_DEPRECATED_PRAGMA(). Copying over those (along with a few related definitions) is enough:

--- generic/tclTomMath.h.orig
+++ generic/tclTomMath.h
@@ -24,6 +24,14 @@
 #   define MP_VAL        -3  /* invalid input */
 #   define MP_ITER       -4  /* maximum iterations reached */
 #   define MP_BUF        -5  /* buffer overflow, supplied buffer too small */
+    typedef int mp_order;
+#   define MP_LSB_FIRST -1
+#   define MP_MSB_FIRST  1
+    typedef int mp_endian;
+#   define MP_LITTLE_ENDIAN  -1
+#   define MP_NATIVE_ENDIAN  0
+#   define MP_BIG_ENDIAN     1
+#   define MP_DEPRECATED_PRAGMA(s) /* nothing */
 #   define MP_WUR            /* nothing */
 #   define mp_iszero(a) ((a)->used == 0)
 #   define mp_isneg(a)  ((a)->sign != 0)

User Comments: jan.nijtmans added on 2023-04-22 17:46:14:

Good suggestion. Thanks! I see no reason to reject this suggestion.