From efca43aaa733fc63f9f993bad68e4e11a0c376f7 Mon Sep 17 00:00:00 2001 From: Surendra Singhi Date: Wed, 25 Jan 2006 12:40:05 +0000 Subject: [PATCH] Fixed the void* bug. Thanks to Matthias. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8552 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/cffi.cxx | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/SWIG/Source/Modules/cffi.cxx b/SWIG/Source/Modules/cffi.cxx index 92a156ba6..4d4603ff7 100644 --- a/SWIG/Source/Modules/cffi.cxx +++ b/SWIG/Source/Modules/cffi.cxx @@ -478,19 +478,25 @@ void CFFI :: emit_struct_union(Node *n, bool un=false) { // SWIG_exit(EXIT_FAILURE); } else{ - String *temp=Copy(Getattr(c,"decl")); - Append(temp,Getattr(c,"type")); //appending type to the end, otherwise wrong type - String *lisp_type=Swig_typemap_lookup_new("cin",c, "",0); - Delete(temp); + // String *temp=Copy(Getattr(c,"decl")); + // Append(temp,Getattr(c,"type")); //appending type to the end, otherwise wrong type + // String *lisp_type=Swig_typemap_lookup_new("cin",c, "",0); + // Delete(temp); + SwigType *childType=NewStringf("%s%s", Getattr(c,"decl"), + Getattr(c,"type")); - String *slot_name = Getattr(c, "sym:name"); - Printf(f_cl, - "\n\t(%s %s)", - slot_name, - lisp_type); + Hash *typemap = Swig_typemap_search("cin", childType,"", 0); + String *typespec = NewString(""); + if (typemap) { + typespec=Getattr(typemap, "code"); + } - Delete(lisp_type); - } + String *slot_name = Getattr(c, "sym:name"); + Printf(f_cl, "\n\t(%s %s)", slot_name, typespec); + + Delete(slot_name); + Delete(typespec); + } } Printf(f_cl, ")\n");