From: Olly B. <ol...@su...> - 2006-11-10 06:00:04
|
On 2006-09-22, kr...@su... <kr...@su...> wrote: > Olly, if you could please, try running some of your more complex php > wrapped libraries to see if anything is really out of place. With SWIG from branch-php-utl and PHP4, the generated wrapper for Xapian doesn't even build. The first problem is that SWIG_exception is no longer defined, but I call it from my %exception handler. I can't call SWIG_exception_fail because destructors don't have a "fail" label. And I can't call SWIG_Error because that tries to SWIG_fail too. Hmm, in fact the "SWIG_fail" in SWIG_exception_fail is redundant, since SWIG_Error always does a SWIG_fail anyway. Changing my %exception handler to just call zend_error like it effectively used to lets the build continue. I think it would be better to add a "fail" label to destructors really. Next problem - I have a few custom typemaps which call SWIG_ConvertPtr. However, the prototype for this has changed and it now wants "zval **" for the first argument (this used to be "zval *"). I can't see why that's changed though - it doesn't look like SWIG_ConvertPtr now modifies this argument or anything like that... Anyway, hacking my typemaps to reflect this change, the next problem I hit is there's lots of errors for lines of generated code like this: if (SWIG_IsNewObj(res2)) delete arg2; The problem is that "res2" isn't defined anywhere in the wrapper function with this code in. I get these for res3/arg3 too. Looking at the generated code, arg2 just seems to be a pointer to a different local variable, so we don't ever want to delete it. I didn't check every case though, as I get lots and lots of these! And that's where I've given up for now ... Cheers, Olly |