On Tue, Jul 26, 2005 at 02:11:59AM +0900, Steven Jenkins wrote:
> Esteban Manchado Vel?zquez wrote:
> >Hi,
> >
> >   I'm doing some experiments with SWIG (trying to make a Ruby interface 
> >   for
> >MuSE low-level sound classes), and I'm having some problems.
> >
> >   One of them is really weird: it seems that there are problems with 
> >   extern
> >"C" declarations (from C++) and with functions _named_ "error" (namely, 
> >that
> >when you try to call the function, the interpreter aborts, without 
> >exceptions
> >or anything).
> 
> I played around with this a little yesterday afternoon and saw exactly 
> the problem you desribe on Gentoo Linux. I ran gcc -E looking for a 
> global 'error' pulled in from some header file, but found nothing. I'm 
> stumped.
> 
> You might try it without SWIG--just write your own version of 
> _wrap_error() using the Ruby C API. I suspect it'll have the same 
> problem, but if not, you'll know the problem is with SWIG.

   The only conclusion I've reached is that a function named "error" can't be
declared in C (and I guess this goes for _every_ Ruby C extension), probably
because it's declared somewhere. The problem is, I don't know where and I
don't have the slightliest idea of where to find it (in the interpreter
code?).

   As I was told by a friend, it probably works in C++ (without the extern "C"
thing) because of C++ function name mangling.

   I guess I'll have to remove the extern "C" declarations from MuSE, to be
able to make the Ruby interface :-/

   Best regards, and thanks again for trying...

-- 
Esteban Manchado Vel?zquez <zoso / foton.es> - http://www.foton.es
EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es