summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tcl.h5
-rw-r--r--generic/tclBinary.c6
-rw-r--r--generic/tclInt.h16
3 files changed, 13 insertions, 14 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 3b9d483..285c1f5 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -47,7 +47,12 @@ extern "C" {
* unix/tcl.spec (1 LOC patch)
*/
+#if !defined(TCL_MAJOR_VERSION)
#define TCL_MAJOR_VERSION 8
+#endif
+#if TCL_MAJOR_VERSION != 8
+#error "This header-file is for Tcl 8 only"
+#endif
#define TCL_MINOR_VERSION 7
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
#define TCL_RELEASE_SERIAL 6
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 5678a66..bf40924 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -556,12 +556,8 @@ TclGetByteArrayFromObj(
baPtr = GET_BYTEARRAY(irPtr);
if (numBytesPtr != NULL) {
-#if TCL_MAJOR_VERSION > 8
- *numBytesPtr = baPtr->used;
-#else
- /* TODO: What's going on here? Document or eliminate. */
+ /* Make sure we return a value between 0 and UINT_MAX-1, or (size_t)-1 */
*numBytesPtr = ((size_t)(unsigned int)(baPtr->used + 1)) - 1;
-#endif
}
return baPtr->bytes;
}
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 1a504f4..ee3dbf8 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -1901,7 +1901,7 @@ typedef struct Interp {
* See Tcl_AppendResult code for details.
*/
-#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+#if !defined(TCL_NO_DEPRECATED)
char *appendResult; /* Storage space for results generated by
* Tcl_AppendResult. Ckalloc-ed. NULL means
* not yet allocated. */
@@ -1975,13 +1975,11 @@ typedef struct Interp {
* string. Returned by Tcl_ObjSetVar2 when
* variable traces change a variable in a
* gross way. */
-#if TCL_MAJOR_VERSION < 9
-# if !defined(TCL_NO_DEPRECATED)
+#if !defined(TCL_NO_DEPRECATED)
char resultSpace[TCL_DSTRING_STATIC_SIZE+1];
/* Static space holding small results. */
-# else
+#else
char resultSpaceDontUse[TCL_DSTRING_STATIC_SIZE+1];
-# endif
#endif
Tcl_Obj *objResultPtr; /* If the last command returned an object
* result, this points to it. Should not be
@@ -2646,7 +2644,7 @@ typedef Tcl_Channel (TclOpenFileChannelProc_)(Tcl_Interp *interp,
*----------------------------------------------------------------
*/
-#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+#if !defined(TCL_NO_DEPRECATED)
typedef Tcl_CmdProc *TclCmdProcType;
typedef Tcl_ObjCmdProc *TclObjCmdProcType;
#endif
@@ -2717,7 +2715,7 @@ typedef struct ProcessGlobalValue {
*/
#define TCL_NUMBER_INT 2
-#if (TCL_MAJOR_VERSION < 9) && !defined(TCL_NO_DEPRECATED)
+#if !defined(TCL_NO_DEPRECATED)
# define TCL_NUMBER_LONG 1 /* deprecated, not used any more */
# define TCL_NUMBER_WIDE TCL_NUMBER_INT /* deprecated */
#endif
@@ -3380,7 +3378,7 @@ MODULE_SCOPE Tcl_Command TclInitBinaryCmd(Tcl_Interp *interp);
MODULE_SCOPE int Tcl_BreakObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+#if !defined(TCL_NO_DEPRECATED)
MODULE_SCOPE int Tcl_CaseObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
@@ -4586,7 +4584,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
(objPtr)->typePtr = NULL; \
}
-#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 8
+#if !defined(TCL_NO_DEPRECATED)
# define TclFreeIntRep(objPtr) TclFreeInternalRep(objPtr)
#endif