From: John L. <wu...@us...> - 2005-03-16 06:51:13
|
Update of /cvsroot/swig/SWIG/Source/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23430/Source/Modules Modified Files: chicken.cxx Log Message: Fix a few more chicken bugs Index: chicken.cxx =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Modules/chicken.cxx,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** chicken.cxx 15 Mar 2005 23:02:58 -0000 1.33 --- chicken.cxx 16 Mar 2005 06:51:03 -0000 1.34 *************** *** 62,65 **** --- 62,66 ---- static int in_class = 0; static int have_constructor = 0; + static String *constructor_name = 0; static bool exporting_destructor = false; static int useclassprefix = 0; *************** *** 1003,1014 **** Printf(closcode, ")))\n"); - String *newmethod = NewStringf("new-%s", short_class_name); - if (have_constructor) { Printv(closcode, "(define-method (initialize (obj ", class_name, ") initargs)\n", " (call-next-method)\n", ! " (swig-initialize obj initargs ", chickenPrimitiveName(newmethod), ")\n", ")\n", NIL); } else { Printv(closcode, "(define-method (initialize (obj ", class_name, ") initargs)\n", --- 1004,1015 ---- Printf(closcode, ")))\n"); if (have_constructor) { Printv(closcode, "(define-method (initialize (obj ", class_name, ") initargs)\n", " (call-next-method)\n", ! " (swig-initialize obj initargs ", chickenPrimitiveName(constructor_name), ")\n", ")\n", NIL); + Delete(constructor_name); + constructor_name = 0; } else { Printv(closcode, "(define-method (initialize (obj ", class_name, ") initargs)\n", *************** *** 1018,1023 **** } - Delete(newmethod); - Printf(closcode, "%s\n", clos_class_methods); Delete(clos_class_methods); --- 1019,1022 ---- *************** *** 1160,1163 **** --- 1159,1166 ---- Language::constructorHandler(n); have_constructor = 1; + String *iname = Getattr(n,"sym:name"); + if (constructor_name) Delete(constructor_name); + constructor_name = Swig_name_construct(iname); + Replaceall(constructor_name, "_", "-"); return SWIG_OK; } |