summaryrefslogtreecommitdiff
path: root/Source/cmVTKWrapTclCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-07-26 09:54:47 -0400
committerBrad King <brad.king@kitware.com>2002-07-26 09:54:47 -0400
commit20b1d940a407c4e8184e0aff73fa76ce0dafcb2b (patch)
tree4a7f5d9827d91ec5bd6fd6fd3f165b213aa3abef /Source/cmVTKWrapTclCommand.cxx
parent6811b49d2b5305dfe099f26ce1dc5a1255a2b379 (diff)
downloadcmake-20b1d940a407c4e8184e0aff73fa76ce0dafcb2b.tar.gz
BUG: Generated call to Tcl_CreateCommand for vtkCommand should cast pointer to extern "C" version.
Diffstat (limited to 'Source/cmVTKWrapTclCommand.cxx')
-rw-r--r--Source/cmVTKWrapTclCommand.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmVTKWrapTclCommand.cxx b/Source/cmVTKWrapTclCommand.cxx
index 5a707db702..172e032a98 100644
--- a/Source/cmVTKWrapTclCommand.cxx
+++ b/Source/cmVTKWrapTclCommand.cxx
@@ -229,6 +229,13 @@ bool cmVTKWrapTclCommand::WriteInit(const char *kitName,
fprintf(fout,"#include \"vtkTclUtil.h\"\n");
+ fprintf(fout,
+ "extern \"C\"\n"
+ "{\n"
+ " typedef int (*vtkTclCommandType)(ClientData, Tcl_Interp *,int, char *[]);\n"
+ "}\n"
+ "\n");
+
for (i = 0; i < classes.size(); i++)
{
fprintf(fout,"int %sCommand(ClientData cd, Tcl_Interp *interp,\n int argc, char *argv[]);\n",classes[i].c_str());
@@ -300,7 +307,9 @@ bool cmVTKWrapTclCommand::WriteInit(const char *kitName,
" Tcl_CreateExitHandler(vtkCommonDeleteAssocData,(ClientData *)info);\n");
/* create special vtkCommand command */
- fprintf(fout," Tcl_CreateCommand(interp,(char *) \"vtkCommand\",vtkCommand,\n (ClientData *)NULL, NULL);\n\n");
+ fprintf(fout," Tcl_CreateCommand(interp,(char *) \"vtkCommand\",\n"
+ " reinterpret_cast<vtkTclCommandType>(vtkCommand),\n"
+ " (ClientData *)NULL, NULL);\n\n");
}
for (i = 0; i < m_Commands.size(); i++)