From: John L. <wu...@us...> - 2004-11-03 23:14:14
|
Update of /cvsroot/swig/SWIG/Source/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2115/Source/Modules Modified Files: chicken.cxx Log Message: Fix a bug where chicken wrappers were not correctly registering values with the chicken garbage collector. Update the chicken documentation to reflect the new proxy class support. Index: chicken.cxx =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Modules/chicken.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** chicken.cxx 2 Nov 2004 03:10:50 -0000 1.22 --- chicken.cxx 3 Nov 2004 23:13:59 -0000 1.23 *************** *** 231,235 **** Printv(f_scm,"(declare \n", tab4, "(hide swig-init)\n", ! tab4, "(foreign-declare \"C_extern void swig_", module, "_init(int,C_word,C_word) C_noret;\"))\n", NIL); Printv(f_scm,"(define swig-init (##core#primitive \"swig_", module, "_init\"))\n", NIL); --- 231,235 ---- Printv(f_scm,"(declare \n", tab4, "(hide swig-init)\n", ! tab4, "(foreign-declare \"C_extern void swig_", module, "_init(C_word,C_word,C_word) C_noret;\"))\n", NIL); Printv(f_scm,"(define swig-init (##core#primitive \"swig_", module, "_init\"))\n", NIL); *************** *** 361,369 **** "static ", "void ", wname, ! " (int argc, C_word closure, C_word continuation", NIL); Printv(declfunc, "void ", wname, ! "(int,C_word,C_word", NIL); --- 361,369 ---- "static ", "void ", wname, ! " (C_word argc, C_word closure, C_word continuation", NIL); Printv(declfunc, "void ", wname, ! "(C_word,C_word,C_word", NIL); *************** *** 667,675 **** Printv(f->def, "static ", ! "void ",wname,"(int, C_word, C_word, C_word) C_noret;\n", NIL); Printv(f->def, "static " ! "void ",wname,"(int argc, C_word closure, " "C_word continuation, C_word value) {\n", NIL); --- 667,675 ---- Printv(f->def, "static ", ! "void ",wname,"(C_word, C_word, C_word, C_word) C_noret;\n", NIL); Printv(f->def, "static " ! "void ",wname,"(C_word argc, C_word closure, " "C_word continuation, C_word value) {\n", NIL); *************** *** 836,845 **** Printv(f->def, "static ", ! "void ",wname,"(int, C_word, C_word) C_noret;\n", NIL); Printv(f->def, "static ", ! "void ",wname,"(int argc, C_word closure, " "C_word continuation) {\n", NIL); --- 836,845 ---- Printv(f->def, "static ", ! "void ",wname,"(C_word, C_word, C_word) C_noret;\n", NIL); Printv(f->def, "static ", ! "void ",wname,"(C_word argc, C_word closure, " "C_word continuation) {\n", NIL); *************** *** 951,955 **** swigtype_ptr = SwigType_manglestr(ct); ! Printf(f_runtime, "static swig_chicken_clientdata _swig_chicken_clientdata%s = { C_SCHEME_UNDEFINED };\n", mangled_classname); Printv(f_init, "SWIG_TypeClientData(SWIGTYPE", swigtype_ptr,", (void *) &_swig_chicken_clientdata", mangled_classname, ");\n", NIL); --- 951,955 ---- swigtype_ptr = SwigType_manglestr(ct); ! Printf(f_runtime, "static swig_chicken_clientdata _swig_chicken_clientdata%s = { 0 };\n", mangled_classname); Printv(f_init, "SWIG_TypeClientData(SWIGTYPE", swigtype_ptr,", (void *) &_swig_chicken_clientdata", mangled_classname, ");\n", NIL); *************** *** 972,976 **** " (call-next-method)\n", " (swig-initialize obj initargs ", chickenPrimitiveName(newmethod), ")\n", ! " (set-finalizer! obj (lambda (x) (", chickenPrimitiveName(delmethod), " (slot-ref x 'swig-this))))", ")\n", NIL); --- 972,976 ---- " (call-next-method)\n", " (swig-initialize obj initargs ", chickenPrimitiveName(newmethod), ")\n", ! //" (set-finalizer! obj (lambda (x) (", chickenPrimitiveName(delmethod), " (slot-ref x 'swig-this))))", ")\n", NIL); *************** *** 996,1003 **** Replaceall(closfuncname, "_", "-"); ! Printv(f_wrappers, "static void ", funcname, "(int,C_word,C_word,C_word) C_noret;\n", ! "static void ", funcname, "(int argc, C_word closure, C_word continuation, C_word cl) {\n", " C_trace(\"", funcname, "\");\n", ! " C_mutate(&((swig_chicken_clientdata *)(SWIGTYPE", swigtype_ptr,"->clientdata))->clos_class, cl);\n", " C_kontinue(continuation, C_SCHEME_UNDEFINED);\n", "}\n", NIL); --- 996,1005 ---- Replaceall(closfuncname, "_", "-"); ! Printv(f_wrappers, "static void ", funcname, "(C_word,C_word,C_word,C_word) C_noret;\n", ! "static void ", funcname, "(C_word argc, C_word closure, C_word continuation, C_word cl) {\n", " C_trace(\"", funcname, "\");\n", ! " swig_chicken_clientdata *cdata = (swig_chicken_clientdata *) SWIGTYPE", swigtype_ptr,"->clientdata;\n", ! " cdata->gc_proxy_create = CHICKEN_new_gc_root();\n", ! " CHICKEN_gc_root_set(cdata->gc_proxy_create, cl);\n", " C_kontinue(continuation, C_SCHEME_UNDEFINED);\n", "}\n", NIL); *************** *** 1131,1140 **** Printv(f->def, "static void real_", wname, ! "(int, C_word, C_word, C_word) C_noret;\n", NIL); Printv(f->def, "static void real_", wname, ! "(int, C_word closure, C_word continuation, C_word args) {", NIL); --- 1133,1142 ---- Printv(f->def, "static void real_", wname, ! "(C_word, C_word, C_word, C_word) C_noret;\n", NIL); Printv(f->def, "static void real_", wname, ! "(C_word oldargc, C_word closure, C_word continuation, C_word args) {", NIL); *************** *** 1165,1171 **** /* varargs */ Printv(f->def, "void ", wname, ! "(int, C_word, C_word, ...) C_noret;\n", NIL); Printv(f->def, "void ", wname, ! "(int c, C_word t0, C_word t1, ...) {", NIL); Printv(f->code, --- 1167,1173 ---- /* varargs */ Printv(f->def, "void ", wname, ! "(C_word, C_word, C_word, ...) C_noret;\n", NIL); Printv(f->def, "void ", wname, ! "(C_word c, C_word t0, C_word t1, ...) {", NIL); Printv(f->code, |