Skip to content

Commit

Permalink
Apply patch from Petr Viktorin to fix some recent regressions in CFFI…
Browse files Browse the repository at this point in the history
…/CLOS

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10487 626c5289-ae23-0410-ae9c-e8d60b6d4f22
  • Loading branch information
wsfulton committed May 21, 2008
1 parent bfb5a09 commit 8b42082
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Lib/cffi/cffi.swg
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
short, signed short, unsigned short,
int, signed int, unsigned int,
long, signed long, unsigned long,
float, double, long double, char *, void *
float, double, long double, char *, void *,
enum SWIGTYPE, SWIGTYPE *,
SWIGTYPE[ANY], SWIGTYPE & "$result = $1;";
#ifdef __cplusplus
Expand Down Expand Up @@ -125,8 +125,9 @@
int, signed int, unsigned int,
long, signed long, unsigned long,
enum SWIGTYPE "cl:integer";
%typemap(lispclass) float "cl:single-float";
%typemap(lispclass) double "cl:double-float";
/* CLOS methods can't be specialized on single-float or double-float */
%typemap(lispclass) float "cl:number";
%typemap(lispclass) double "cl:number";
%typemap(lispclass) char * "cl:string";


Expand Down
4 changes: 2 additions & 2 deletions Source/Modules/cffi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ int CFFI::functionWrapper(Node *n) {
String *result_convert = Swig_typemap_lookup_out("out", n, "result", f, actioncode);
Replaceall(result_convert, "$result", "lresult");
Printf(f->code, "%s\n", result_convert);
Printf(f->code, " return lresult;\n");
if(!is_void_return) Printf(f->code, " return lresult;\n");
Delete(result_convert);
emit_return_variable(n, Getattr(n, "type"), f);

Expand Down Expand Up @@ -673,7 +673,7 @@ void CFFI::emit_class(Node *n) {

Printf(supers, ")");
Printf(f_clos, "\n(cl:defclass %s%s", lisp_name, supers);
Printf(f_clos, "\n ((ff :reader ff-pointer)))\n\n");
Printf(f_clos, "\n ((ff-pointer :reader ff-pointer)))\n\n");

Parm *pattern = NewParm(Getattr(n, "name"), NULL);

Expand Down

0 comments on commit 8b42082

Please sign in to comment.