From: Lyle Johnson Date: 2002-03-29T11:12:13+09:00 Subject: Re: Ruby SWIG problems > I've noticed a similar when trying to create a wrapper for C program. > I finally wound up using the skeleton produced by SWIG, and writing my own > code inside each "wrapper", then deleting all the SWIG-related small > service routines that were no longer called by anyone. From the short > time that I spent looking at it, I think that the problem is that SWIG > thinks that all VALUES contain pointers to the real data, and tries to > get the pointer, and extract the real data. So, it may work fine when > used to wrap routines that receive arrays, hashes, and strings, but will > not work too well for routines that expect FixNum's and booleans. FWIW. Which version of SWIG was this? This is the first time I've ever heard of this particular problem. At any rate, a lot of work has been done on SWIG's Ruby module in the recent past, and in particular the development version in CVS (which will eventually be released as SWIG 1.3.12) is pretty solid. I'd encourage you to take another look if you have time (and an applicable project, of course!) > For my purposes, it was easier to work around it than to try to get the > attention and time of somebody on the SWIG project, and get him to fix > SWIG. Hmmm. Just did a quick google search of the SWIG mailing list archives (since 1999 or so) and your name didn't turn up at all. Maybe you were trying to get the attention of the wrong people ;) > If you have alot (e.g., 100 or so) routines that you are trying to > get SWIG to build wrappers for, you may find it worth your while to try > to go in and hack the SWIG support routines that all of the wrapped code > depends on. Your call. Good luck. Generally speaking, you shouldn't need to touch the SWIG-generated wrapper code at all. If there's something that you think warrants such hacking, bring it up on the SWIG mailing list list and let's see if we can find a better solution.