diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-07-27 13:19:48 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-07-27 13:19:48 (GMT) |
| commit | 78c6a505b786496bbdb798537d42d533ff61a3fe (patch) | |
| tree | f6fbc4ff222f1841e640078515764afec9d5d129 | |
| parent | 503165d9c2e5c4c5f35681047d987d17debcf2a5 (diff) | |
| download | tcl-78c6a505b786496bbdb798537d42d533ff61a3fe.zip tcl-78c6a505b786496bbdb798537d42d533ff61a3fe.tar.gz tcl-78c6a505b786496bbdb798537d42d533ff61a3fe.tar.bz2 | |
Demonstration how to add TCL_OBJTYPE_V3, while keeping upwards compatibility: all other TCL_OBJTYPE_V? macro's continue to work
| -rw-r--r-- | generic/tcl.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 306e1e1..41757ea 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -671,16 +671,19 @@ typedef struct Tcl_ObjType { Tcl_ObjTypeSetElement *setElementProc; /* Replace the element at the indicie ** with the given valueObj. */ Tcl_ObjTypeReplaceProc *replaceProc; /* Replace subset with subset */ + void *reservedProc; /* Reserved for version 3, to be filled in */ #endif } Tcl_ObjType; #if TCL_MAJOR_VERSION > 8 # define TCL_OBJTYPE_V0 0, \ - 0,0,0,0,0,0,0 /* Pre-Tcl 9 */ + 0,0,0,0,0,0,0,0 /* Pre-Tcl 9 */ # define TCL_OBJTYPE_V1(a) offsetof(Tcl_ObjType, indexProc), \ - a,0,0,0,0,0,0 /* Tcl 9 Version 1 */ -# define TCL_OBJTYPE_V2(a,b,c,d,e,f,g) sizeof(Tcl_ObjType), \ - a,b,c,d,e,f,g /* Tcl 9 - AbstractLists */ + a,0,0,0,0,0,0,0 /* Tcl 9 Version 1 */ +# define TCL_OBJTYPE_V2(a,b,c,d,e,f,g) offsetof(Tcl_ObjType, reservedProc), \ + a,b,c,d,e,f,g,0 /* Tcl 9 - AbstractLists */ +# define TCL_OBJTYPE_V3(a,b,c,d,e,f,g,h) sizeof(Tcl_ObjType), \ + a,b,c,d,e,f,g,h /* Tcl 9 - AbstractLists, version 3 */ #else # define TCL_OBJTYPE_V0 /* just empty */ #endif |
