From: John L. <wu...@us...> - 2004-10-07 02:31:36
|
Update of /cvsroot/swig/SWIG/Source/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19421/Source/Modules Modified Files: tcl8.cxx Log Message: Fix a few bugs in the tcl module related to clientdata propagation. Index: tcl8.cxx =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Modules/tcl8.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcl8.cxx 23 Aug 2004 20:05:51 -0000 1.12 --- tcl8.cxx 7 Oct 2004 02:31:13 -0000 1.13 *************** *** 44,47 **** --- 44,48 ---- static String *ns_name = 0; static int have_constructor; + static String *constructor_name; static int have_destructor; static int have_base_classes; *************** *** 748,751 **** --- 749,753 ---- String *base_class = NewString(""); + String *base_class_names = NewString(""); if( itcl ) { *************** *** 773,780 **** // Printf(base_class,"&_wrap_class_%s",bmangle); Printf(base_class,"0"); /* Put code to register base classes in init function */ ! Printf(f_init,"/* Register base : %s */\n", bmangle); ! Printf(f_init,"swig_%s_bases[%d] = (swig_class *) SWIG_TypeQuery(\"%s *\")->clientdata;\n", mangled_classname, index, SwigType_namestr(bname)); b = Next(b); index++; --- 775,783 ---- // Printf(base_class,"&_wrap_class_%s",bmangle); Printf(base_class,"0"); + Printf(base_class_names,"\"%s *\",", SwigType_namestr(bname)); /* Put code to register base classes in init function */ ! //Printf(f_init,"/* Register base : %s */\n", bmangle); ! //Printf(f_init,"swig_%s_bases[%d] = (swig_class *) SWIG_TypeQuery(\"%s *\")->clientdata;\n", mangled_classname, index, SwigType_namestr(bname)); b = Next(b); index++; *************** *** 886,890 **** --- 889,895 ---- Printv(f_wrappers,"static swig_class *swig_",mangled_classname,"_bases[] = {", base_class,"0};\n", NIL); + Printv(f_wrappers,"static char *swig_",mangled_classname,"_base_names[] = {", base_class_names,"0};\n", NIL); Delete(base_class); + Delete(base_class_names); Printv(f_wrappers, "swig_class _wrap_class_", mangled_classname, " = { \"", class_name, *************** *** 892,896 **** if (have_constructor) { ! Printf(f_wrappers,"%s", Swig_name_wrapper(Swig_name_construct(class_name))); } else { Printf(f_wrappers,"0"); --- 897,903 ---- if (have_constructor) { ! Printf(f_wrappers,"%s", Swig_name_wrapper(Swig_name_construct(constructor_name))); ! Delete(constructor_name); ! constructor_name = 0; } else { Printf(f_wrappers,"0"); *************** *** 901,905 **** Printf(f_wrappers,",0"); } ! Printv(f_wrappers, ", swig_", mangled_classname, "_methods, swig_", mangled_classname, "_attributes, swig_", mangled_classname,"_bases };\n", NIL); if( !itcl ) { --- 908,913 ---- Printf(f_wrappers,",0"); } ! Printv(f_wrappers, ", swig_", mangled_classname, "_methods, swig_", mangled_classname, "_attributes, swig_", mangled_classname,"_bases,", ! "swig_", mangled_classname, "_base_names };\n", NIL); if( !itcl ) { *************** *** 1142,1145 **** --- 1150,1154 ---- } + constructor_name = NewString(Getattr(n, "sym:name")); have_constructor = 1; return SWIG_OK; |