[Insight-developers] ITK, WrapITK, and Tcl 8.6

kent williams norman-k-williams at uiowa.edu
Wed Jun 9 15:05:31 EDT 2010


I logged a bug report for the standalone wrapitk project here:
http://code.google.com/p/wrapitk/issues/detail?id=31

But it would affect anyone who A) uses WrapITK + TCL and B) wants to use Tk
on OS X Snow Leopard (or wants to use Tcl/Tk 8.6 or later for any reason).

Basically, Tcl 8.6 makes (by default) the Tcl_Interp structure an opaque
type, so you have to use access methods to get at members.  The following
patch fixes things, and I believe Tcl Wrapping with 8.6 will work OK.

Index: Wrapping/WrapITK/Tcl/itkTclCommand.cxx
===================================================================
RCS file: /cvsroot/Insight/Insight/Wrapping/WrapITK/Tcl/itkTclCommand.cxx,v
retrieving revision 1 </p/wrapitk/source/detail?r=1> .1
diff -c -r1 </p/wrapitk/source/detail?r=1> .1 itkTclCommand.cxx
*** Wrapping/WrapITK/Tcl/itkTclCommand.cxx 6 Sep 2006 20:58:42 -0000 1.1
--- Wrapping/WrapITK/Tcl/itkTclCommand.cxx 9 Jun 2010 14:50:54 -0000
***************
*** 88,96 ****
--- 88,104 ----
      {
      const char* errorInfo = Tcl_GetVar(m_Interpreter, "errorInfo", 0);
      if(!errorInfo) { errorInfo = ""; }
+ #if ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)) ||
(TCL_MAJOR_VERSION > 9)
      itkWarningMacro("Error returned from itk/tcl callback:\n" <<
                      m_CommandString.c_str() << std::endl << errorInfo <<
                      " at line number " << m_Interpreter->errorLine);
+ #else
+     itkWarningMacro("Error returned from itk/tcl callback:\n"
+       << m_CommandString.c_str()
+       << std::endl << errorInfo
+       << " at line number "
+       << Tcl_GetErrorLine(m_Interpreter));
+ #endif
      }
  }






More information about the Insight-developers mailing list