Browse Source

ERR: Tcl_PkgProvide takes char*, so we cannot pass a string literal to it.

Brad King 23 years ago
parent
commit
80c6f0fdec
1 changed files with 5 additions and 4 deletions
  1. 5 4
      Source/cmVTKWrapTclCommand.cxx

+ 5 - 4
Source/cmVTKWrapTclCommand.cxx

@@ -336,10 +336,11 @@ bool cmVTKWrapTclCommand::WriteInit(const char *kitName,
     fprintf(fout,"                  %sCommand);\n",classes[i].c_str());
     fprintf(fout,"                  %sCommand);\n",classes[i].c_str());
     }
     }
   
   
-  fprintf(fout,"  Tcl_PkgProvide(interp, \"%s\", "
-               "VTK_TCL_TO_STRING(VTK_MAJOR_VERSION) \".\" "
-               "VTK_TCL_TO_STRING(VTK_MINOR_VERSION));\n",
-          m_LibraryName.c_str());
+  fprintf(fout,"  char pkgName[]=\"%s\";\n", m_LibraryName.c_str());
+  fprintf(fout,"  char pkgVers[]=VTK_TCL_TO_STRING(VTK_MAJOR_VERSION)"
+               " \".\" "
+               "VTK_TCL_TO_STRING(VTK_MINOR_VERSION);\n");
+  fprintf(fout,"  Tcl_PkgProvide(interp, pkgName, pkgVers);\n");
   fprintf(fout,"  return TCL_OK;\n}\n");
   fprintf(fout,"  return TCL_OK;\n}\n");
   fclose(fout);
   fclose(fout);