summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-08-08 00:57:40 (GMT)
committerhobbs <hobbs>2000-08-08 00:57:40 (GMT)
commit1f56cc3bd7c10b07de64aa72628cf3a49347b379 (patch)
tree39abc893913e1c4721f6f8ff84de17d73fee917c
parentaccffd7c200d4cf709edb6e06f8340c58ccfcc81 (diff)
downloadtcl-1f56cc3bd7c10b07de64aa72628cf3a49347b379.zip
tcl-1f56cc3bd7c10b07de64aa72628cf3a49347b379.tar.gz
tcl-1f56cc3bd7c10b07de64aa72628cf3a49347b379.tar.bz2
* generic/tclIO.c (Tcl_CreateChannel): added assertion to verify
that the new channel versioning will be binary compatible with older channel drivers.
-rw-r--r--generic/tclIO.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index e78d242..c6c0e62 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,12 +10,13 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.20.2.4 2000/07/27 01:39:15 hobbs Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.20.2.5 2000/08/08 00:57:40 hobbs Exp $
*/
#include "tclInt.h"
#include "tclPort.h"
#include "tclIO.h"
+#include <assert.h>
/*
@@ -66,7 +67,6 @@ typedef struct ThreadSpecificData {
static Tcl_ThreadDataKey dataKey;
-
/*
* Static functions in this file:
*/
@@ -948,6 +948,18 @@ Tcl_CreateChannel(typePtr, chanName, instanceData, mask)
CONST char *name;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ /*
+ * With the change of the Tcl_ChannelType structure to use a version in
+ * 8.3.2+, we have to make sure that our assumption that the structure
+ * remains a binary compatible size is true.
+ *
+ * If this assertion fails on some system, then it can be removed
+ * only if the user recompiles code with older channel drivers in
+ * the new system as well.
+ */
+
+ assert(sizeof(Tcl_ChannelTypeVersion) == sizeof(Tcl_DriverBlockModeProc*));
+
chanPtr = (Channel *) ckalloc((unsigned) sizeof(Channel));
statePtr = (ChannelState *) ckalloc((unsigned) sizeof(ChannelState));
chanPtr->state = statePtr;