~ubuntu-branches/ubuntu/quantal/swig2.0/quantal

« back to all changes in this revision

Viewing changes to Source/Modules/mzscheme.cxx

  • Committer: Package Import Robot
  • Author(s): Stefano Rivera
  • Date: 2012-06-01 17:05:17 UTC
  • mfrom: (1.1.6) (10.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20120601170517-q0ik32ij61i4r6f0
Tags: 2.0.7-2ubuntu1
* Merge from Debian unstable (LP: #1006387). Remaining changes:
  - Drop libchicken-dev from the build-depends (in universe).

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 * Mzscheme language module for SWIG.
12
12
 * ----------------------------------------------------------------------------- */
13
13
 
14
 
char cvsroot_mzscheme_cxx[] = "$Id: mzscheme.cxx 12558 2011-03-26 23:25:14Z wsfulton $";
 
14
char cvsroot_mzscheme_cxx[] = "$Id: mzscheme.cxx 12830 2011-10-30 21:51:50Z wsfulton $";
15
15
 
16
16
#include "swigmod.h"
17
17
 
250
250
      ParmList *parms = Getattr(n, "parms");
251
251
      SwigType *type = Getattr(n, "type");
252
252
      String *name = NewString("caller");
253
 
      Setattr(n, "wrap:action", Swig_cresult(type, "result", Swig_cfunction_call(name, parms)));
 
253
      Setattr(n, "wrap:action", Swig_cresult(type, Swig_cresult_name(), Swig_cfunction_call(name, parms)));
254
254
    }
255
255
    // PATCH DLOPEN
256
256
 
403
403
    String *actioncode = emit_action(n);
404
404
 
405
405
    // Now have return value, figure out what to do with it.
406
 
    if ((tm = Swig_typemap_lookup_out("out", n, "result", f, actioncode))) {
407
 
      Replaceall(tm, "$source", "result");
 
406
    if ((tm = Swig_typemap_lookup_out("out", n, Swig_cresult_name(), f, actioncode))) {
 
407
      Replaceall(tm, "$source", Swig_cresult_name());
408
408
      Replaceall(tm, "$target", "values[0]");
409
409
      Replaceall(tm, "$result", "values[0]");
410
410
      if (GetFlag(n, "feature:new"))
426
426
    // Look for any remaining cleanup
427
427
 
428
428
    if (GetFlag(n, "feature:new")) {
429
 
      if ((tm = Swig_typemap_lookup("newfree", n, "result", 0))) {
430
 
        Replaceall(tm, "$source", "result");
 
429
      if ((tm = Swig_typemap_lookup("newfree", n, Swig_cresult_name(), 0))) {
 
430
        Replaceall(tm, "$source", Swig_cresult_name());
431
431
        Printv(f->code, tm, "\n", NIL);
432
432
      }
433
433
    }
434
434
    // Free any memory allocated by the function being wrapped..
435
435
 
436
 
    if ((tm = Swig_typemap_lookup("ret", n, "result", 0))) {
437
 
      Replaceall(tm, "$source", "result");
 
436
    if ((tm = Swig_typemap_lookup("ret", n, Swig_cresult_name(), 0))) {
 
437
      Replaceall(tm, "$source", Swig_cresult_name());
438
438
      Printv(f->code, tm, "\n", NIL);
439
439
    }
440
440
    // Wrap things up (in a manner of speaking)