BUG: Generated call to Tcl_CreateCommand for vtkCommand should cast pointer to extern "C" version.

This commit is contained in:
Brad King 2002-07-26 09:54:47 -04:00
parent 6811b49d2b
commit 20b1d940a4
1 changed files with 10 additions and 1 deletions

View File

@ -229,6 +229,13 @@ bool cmVTKWrapTclCommand::WriteInit(const char *kitName,
fprintf(fout,"#include \"vtkTclUtil.h\"\n"); 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++) 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()); 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"); " Tcl_CreateExitHandler(vtkCommonDeleteAssocData,(ClientData *)info);\n");
/* create special vtkCommand command */ /* 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++) for (i = 0; i < m_Commands.size(); i++)