Here's the patch to restore libpgtcl compatibility with Tcl-8.0, which was
lost in 7.4RC1 with my other patch to fix corrupt binary large-object reads
and writes. This patch is against PostgreSQL-7.4RC1.  I've tested it with
Tcl-8.0.5 (minimally, since tcltest doesn't work with Tcl-8.0).  At least I
can say it builds and handles binary large object data OK with Tcl-8.0.5.
Of course, it also builds and works with Tcl-8.4.4.


*** src/interfaces/libpgtcl/pgtclCmds.c.orig    Thu Oct 30 19:18:55 2003
--- src/interfaces/libpgtcl/pgtclCmds.c Thu Nov  6 21:02:26 2003
***************
*** 1218,1224 ****
--- 1218,1228 ----
  
        if (nbytes >= 0)
        {
+ #if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1 || TCL_MAJOR_VERSION > 8
                bufObj = Tcl_NewByteArrayObj(buf, nbytes);
+ #else
+               bufObj = Tcl_NewStringObj(buf, nbytes);
+ #endif
  
                if (Tcl_ObjSetVar2(interp, bufVar, NULL, bufObj,
                                                   TCL_LEAVE_ERR_MSG | 
TCL_PARSE_PART1) == NULL)
***************
*** 1313,1319 ****
--- 1317,1327 ----
        if (Tcl_GetIntFromObj(interp, objv[2], &fd) != TCL_OK)
                return TCL_ERROR;
  
+ #if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1 || TCL_MAJOR_VERSION > 8
        buf = Tcl_GetByteArrayFromObj(objv[3], &nbytes);
+ #else
+       buf = Tcl_GetStringFromObj(objv[3], &nbytes);
+ #endif
  
        if (Tcl_GetIntFromObj(interp, objv[4], &len) != TCL_OK)
                return TCL_ERROR;

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to