[Ecls-list] Re: DFFI returning cstring's from heap

Dean O'Connor dean.oconnor at ite.com.au
Fri Mar 24 00:08:01 UTC 2006


Just for those interested, I did eventually my C interface converted to 
lisp via SWIG and running in ECL.

I used the latest swigwin-1.3.29 and used the "-uffi" option to generate 
the lisp.

I had to make 2 mods to SWIG code and rebuild it, plus 1 issue that am 
guessing may require minor fix in generated lisp.

1. Swig failed to even run (cldn't write to /dev/null" tho cygwin ok) 
with "-uffi" option due to some seemingly odd swig code/bug.

   - Remove code in Source/Modules/uffi.cxx related to variable "devnull".

2. Swig failed parse due to missing swig type def of C type "bool".

    - Updated Lib/uffi/uffi.swg in swig library to add bool type.

3. When loading generated lisp file into ECL, gave error of  "The 
variable XXXX  is unbound." for constants.

   - Couldn't fix easily. Simply commented out my generated constant 
declarations in lisp file.
  - The problem occurs when the swig-defconstant macro calls 
uffi:def-constant.

So SWIG issues aside, *almost* a painless exercise.

Cheers
Dean.






More information about the ecl-devel mailing list