Overview
| Artifact ID: | 53e3b106bce7e42eef99dcf3529ff52650e71819c8c9e54347bd1850202182f0 |
|---|---|
| Ticket: | 4663e0636f7a24b9363e67c7a3dd25e9e495be17
TIP 538 and Tcl extensions: 'tommath.h' file not found |
| User & Date: | mr_calvin on 2020-05-18 21:44:26 |
Changes
- icomment:
> + typedef size_t mp_int[4]; > Tcl_DecrRefCount(Tcl_NewBignumObj(&bignumValue)); Thanks for this suggestion, I was entertaining a similar thought. Still, I am wondering about TIP 538 and the public Tcl API (please correct me if I am mistaken): Tcl_GetBignumFromObj & friends build on mp_int, functions offered by Tcl as part of its public API but starting with TIP 538, there are no mp_* definitions provided by Tcl itself anymore. An extension or a program integrating with Tcl need to provide a compat definition as a drop-in replacement (as you describe). Is this really necessary and as intended? > Well, Tcl doesn't install <tommath.h> because it could lead to a conflict with the official libtommath version. The alternative being that every tclTomMath.h integrator is on its own regarding tommath.h? If my program or extension was built against Tcl with embedded tommath, it should provide the necessary definitions, doesn't it? Why doesn't Tcl provide this compat/tommath.h (taken from the bundled libtommath sources) if a systemwide libtommath is not available or overriden by --without-system-libtommath (the latter is described in the TIP, at least): So, a TEA-based program or extension would be set up in a way so that, when built against a Tcl with TCL_WITH_EXTERNAL_TOMMATH undefined, it receives compiler flags incl. -I</path/to/tcl/includes/compat/> so it picks up the tommath.h matching the built-in tommath sources. If TCL_WITH_EXTERNAL_TOMMATH was defined, TEA would not deliver this extra -I flag, so the systemwide tommath.h would get picked up. I don't see how this would introduce conflicts (unless a developer messes with the flags on her own, not using TEA, resorting to Tcl's compat/tommath.h on false grounds). What do you think?
- login: "mr_calvin"
- mimetype: "text/plain"