From: Paul Brannan Date: 2002-02-16T06:24:15+09:00 Subject: Re: SWIG/Ruby woes with g++ 3.0 On Sat, Feb 16, 2002 at 05:24:30AM +0900, Luigi Ballabio wrote: > > %{ > > #define rb_define_method(klass, name, func, params) \ > > rb_define_method(klass, name, (VALUE(*)(...))(func), params) > > %} > > Hmm, I don't think it would work. The above is just the VALUEFUNC > macro made explicit---which is what the wrappers do already. The > problem is that the declarations in intern.h should be changed. Oh, right, my mistake. That should read: %{ #define rb_define_method(klass, name, func, params) \ rb_define_method(klass, name, (VALUE(*)())(func), params) %} Or, if you want to be compatible with Ruby 1.7, then: %{ #if RUBY_VERSION < 170 # define rb_define_method(klass, name, func, params) \ rb_define_method(klass, name, (VALUE(*)())(func), params) #endif %} Yes, intern.h should be changed, but since that isn't an option for older versions, the workaround is a necessary evil. Paul