diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-12 08:56:08 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-12 08:56:08 (GMT) |
commit | b2a28063811abb4c3bbe540d8e42b24c571b4588 (patch) | |
tree | 30f870c7f5df25f820f860f674287a5ebecfaa0b /generic/tclInt.h | |
parent | a5c62db26532cc6167321db34f6f97d8bc45875f (diff) | |
download | tcl-b2a28063811abb4c3bbe540d8e42b24c571b4588.zip tcl-b2a28063811abb4c3bbe540d8e42b24c571b4588.tar.gz tcl-b2a28063811abb4c3bbe540d8e42b24c571b4588.tar.bz2 |
Restore the TclGetStringFromObj() macro in tclInt.h as it was in 8.6/8.7
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 14662b7..1fa6786 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4396,6 +4396,11 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, #define TclGetString(objPtr) \ ((objPtr)->bytes? (objPtr)->bytes : Tcl_GetString(objPtr)) +#define TclGetStringFromObj(objPtr, lenPtr) \ + ((objPtr)->bytes \ + ? (*(lenPtr) = (objPtr)->length, (objPtr)->bytes) \ + : (Tcl_GetStringFromObj)((objPtr), (lenPtr))) + /* *---------------------------------------------------------------- * Macro used by the Tcl core to clean out an object's internal @@ -4587,7 +4592,7 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[]; #define TclNumUtfCharsM(numChars, bytes, numBytes) \ do { \ - Tcl_Size _count = 0, _i = (numBytes); \ + Tcl_Size _count, _i = (numBytes); \ unsigned char *_str = (unsigned char *) (bytes); \ while (_i > 0 && (*_str < 0xC0)) { _i--; _str++; } \ _count = (numBytes) - _i; \ |