diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-12-08 17:16:36 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-12-08 17:16:36 (GMT) |
commit | 795fcf4f08882df1123a1ab6228a6cdf31fbb3eb (patch) | |
tree | ce1eec15448d13d9dff53c233970313d8f68876e /generic/tcl.h | |
parent | b5fe898956f0d887cbda3595f970480144e89073 (diff) | |
parent | a7858d818d69719efc88a5de7dfcf85032e7540b (diff) | |
download | tcl-795fcf4f08882df1123a1ab6228a6cdf31fbb3eb.zip tcl-795fcf4f08882df1123a1ab6228a6cdf31fbb3eb.tar.gz tcl-795fcf4f08882df1123a1ab6228a6cdf31fbb3eb.tar.bz2 |
Merge 8.7
Bring back Tcl_InitSubsystems to what Tcl_InitSubsystems was: without additional parameters or additional functionality
Diffstat (limited to 'generic/tcl.h')
-rw-r--r-- | generic/tcl.h | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 31e3419..ba4f0df 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -42,10 +42,6 @@ extern "C" { * win/configure.ac (as above) * win/tcl.m4 (not patchlevel) * README (sections 0 and 2, with and without separator) - * macosx/Tcl.pbproj/project.pbxproj (not patchlevel) 1 LOC - * macosx/Tcl.pbproj/default.pbxuser (not patchlevel) 1 LOC - * macosx/Tcl.xcode/project.pbxproj (not patchlevel) 2 LOC - * macosx/Tcl.xcode/default.pbxuser (not patchlevel) 1 LOC * macosx/Tcl-Common.xcconfig (not patchlevel) 1 LOC * win/README (not patchlevel) (sections 0 and 2) * unix/tcl.spec (1 LOC patch) @@ -751,6 +747,29 @@ typedef struct Tcl_ObjType { } Tcl_ObjType; /* + * The following structure stores an internal representation (intrep) for + * a Tcl value. An intrep is associated with an Tcl_ObjType when both + * are stored in the same Tcl_Obj. The routines of the Tcl_ObjType govern + * the handling of the intrep. + */ + +typedef union Tcl_ObjIntRep { /* The internal representation: */ + long longValue; /* - an long integer value. */ + double doubleValue; /* - a double-precision floating value. */ + void *otherValuePtr; /* - another, type-specific value, */ + /* not used internally any more. */ + Tcl_WideInt wideValue; /* - an integer value >= 64bits */ + struct { /* - internal rep as two pointers. */ + void *ptr1; + void *ptr2; + } twoPtrValue; + struct { /* - internal rep as a pointer and a long, */ + void *ptr; /* not used internally any more. */ + unsigned long value; + } ptrAndLongRep; +} Tcl_ObjIntRep; + +/* * One of the following structures exists for each object in the Tcl system. * An object stores a value as either a string, some internal representation, * or both. @@ -775,40 +794,9 @@ typedef struct Tcl_Obj { * corresponds to the type of the object's * internal rep. NULL indicates the object has * no internal rep (has no type). */ - union { /* The internal representation: */ - long longValue; /* - an long integer value. */ - double doubleValue; /* - a double-precision floating value. */ - void *otherValuePtr; /* - another, type-specific value, not used - * internally any more. */ - Tcl_WideInt wideValue; /* - a long long value. */ - struct { /* - internal rep as two pointers. - * Many uses in Tcl, including a bignum's - * tightly packed fields, where the alloc, - * used and signum flags are packed into - * ptr2 with everything else hung off - * ptr1. */ - void *ptr1; - void *ptr2; - } twoPtrValue; - struct { /* - internal rep as a pointer and a long, - * not used internally any more. */ - void *ptr; - unsigned long value; - } ptrAndLongRep; - } internalRep; + Tcl_ObjIntRep internalRep; /* The internal representation: */ } Tcl_Obj; -/* - * Macros to increment and decrement a Tcl_Obj's reference count, and to test - * whether an object is shared (i.e. has reference count > 1). Note: clients - * should use Tcl_DecrRefCount() when they are finished using an object, and - * should never call TclFreeObj() directly. TclFreeObj() is only defined and - * made public in tcl.h to support Tcl_DecrRefCount's macro definition. - */ - -void Tcl_IncrRefCount(Tcl_Obj *objPtr); -void Tcl_DecrRefCount(Tcl_Obj *objPtr); -int Tcl_IsShared(Tcl_Obj *objPtr); /* *---------------------------------------------------------------------------- @@ -2408,6 +2396,7 @@ EXTERN void Tcl_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact); +EXTERN void Tcl_InitSubsystems(void); EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); #ifndef _WIN32 EXTERN int TclZipfs_AppHook(int *argc, char ***argv); @@ -2482,26 +2471,39 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv); #endif /* !TCL_MEM_DEBUG */ #ifdef TCL_MEM_DEBUG +# undef Tcl_IncrRefCount # define Tcl_IncrRefCount(objPtr) \ Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__) +# undef Tcl_DecrRefCount # define Tcl_DecrRefCount(objPtr) \ Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__) +# undef Tcl_IsShared # define Tcl_IsShared(objPtr) \ Tcl_DbIsShared(objPtr, __FILE__, __LINE__) -#else +#elif (!defined(TCL_NO_DEPRECATED) && defined(USE_TCL_STUBS)) +/* + * When compiling stub-enabled extensions without -DTCL_NO_DEPRECATED, + * those extensions are expected to run fine with Tcl 8.6 as well. + * This means we must continue to use macro's for the above 3 functions, + * and the old stub entry for TclFreeObj. All other usage of TclFreeObj() + * is forbidden now, therefore it is changed to be MODULE_SCOPE internal. + */ +# undef Tcl_IncrRefCount # define Tcl_IncrRefCount(objPtr) \ ++(objPtr)->refCount /* * Use do/while0 idiom for optimum correctness without compiler warnings. * http://c2.com/cgi/wiki?TrivialDoWhileLoop */ +# undef Tcl_DecrRefCount # define Tcl_DecrRefCount(objPtr) \ do { \ Tcl_Obj *_objPtr = (objPtr); \ if ((_objPtr)->refCount-- <= 1) { \ - TclFreeObj(_objPtr); \ + TclOldFreeObj(_objPtr); \ } \ } while(0) +# undef Tcl_IsShared # define Tcl_IsShared(objPtr) \ ((objPtr)->refCount > 1) #endif |