Overview
| Artifact ID: | 68dec8421ab35e0cd6de78f7b0b3b7f2a69c174bf375e7411663b954ec90bdf9 |
|---|---|
| Ticket: | 4663e0636f7a24b9363e67c7a3dd25e9e495be17
TIP 538 and Tcl extensions: 'tommath.h' file not found |
| User & Date: | jan.nijtmans on 2020-05-18 19:50:48 |
Changes
- icomment:
Another (little bit hacky) idea: The only libtommath function used is: mp_clear() This is the same as: Tcl_DecrRefCount(Tcl_NewBignumObj(&bignumValue)); (Just transfer the bignum to a temporary Tcl_Obj, and clear that one....) So, this way, you event don't need <tclTomMath.h> any more. The only thing you have to provide for Tcl 8.7 is the mp_int definition, but just some big enough storage is enough. Here is the patch for nsf: <pre> diff --git a/generic/nsf.c b/generic/nsf.c index 99a2f55c..43242487 100644 --- a/generic/nsf.c +++ b/generic/nsf.c @@ -16652,7 +16652,6 @@ Nsf_ConvertToInt32(Tcl_Interp *interp, Tcl_Obj *objPtr, const Nsf_Param *pPtr, *---------------------------------------------------------------------- */ -#include <tclTomMath.h> int Nsf_ConvertToInteger(Tcl_Interp *interp, Tcl_Obj *objPtr, const Nsf_Param *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) nonnull(1) nonnull(2) nonnull(3) nonnull(4) nonnull(5); @@ -16682,6 +16681,9 @@ Nsf_ConvertToInteger(Tcl_Interp *interp, Tcl_Obj *objPtr, const Nsf_Param *pPtr */ result = TCL_ERROR; } else { +#if TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6 + typedef size_t mp_int[4]; +#endif mp_int bignumValue; /* @@ -16696,7 +16698,7 @@ Nsf_ConvertToInteger(Tcl_Interp *interp, Tcl_Obj *objPtr, const Nsf_Param *pPtr }*/ if ((result = Tcl_GetBignumFromObj(interp, objPtr, &bignumValue)) == TCL_OK) { - mp_clear(&bignumValue); + Tcl_DecrRefCount(Tcl_NewBignumObj(&bignumValue)); } } @@ -35458,9 +35460,6 @@ Nsf_Init( if (Tcl_InitStubs(interp, "8.5", 0) == NULL) { return TCL_ERROR; } - if (Tcl_TomMath_InitStubs(interp, "8.5") == NULL) { - return TCL_ERROR; - } stubsInitialized = 1; } #endif </pre> - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"