On Sunday, February 9, 2003, at 11:47 AM, Randy W. Sims wrote:
Awesome, thanks heaps for the patch. This is the kind of thing that was almost impossible without turning the xsubpp code into a module, so I'm glad someone's taken notice and contributed code.
[...]
I've attached a patch against ExtUtils::ParseXS 1.99 to fix severaly problems under MSWin32. The reason I've posted this to the mailing list is that some of the changes related to the test script are really bad hacks to construct the compile and link commands to build the test XS file, which is something that MakeMaker would be much better at. I thought someone here might make some better suggestions.
Changes include:
* Explicitly untie and close the output file handle because ParseXS was holding the file handle open, preventing the compiler from opening it.
Check.
* Added an '--output FILENAME' flag to xsubpp and changed ParseXS to use the named file in the #line directives when the output file has an extension other than '.c' (i.e. '.cpp').
Check.
* Added conditional definition of the PERL_UNUSED_VAR macro to the output file in case it's not already defined for backwards compatibility with pre-5.8 versions of perl. (Not sure if this is the best solution.)I'm not sure either, but it sounds reasonable to me. It just turns it into a no-op? I'm not quite sure why I didn't see an error when testing against 5.6, though, if PERL_UNUSED_VAR() is new in 5.8.
* In testing ParseXS, I encountered one module that did not expect xsubpp to die when it parsed a file NOT containing a 'MODULE ... PACKAGE ... PREFIX' line. I changed ParseXS so that it instead issued a 'warn' ing. I'm pretty much convinced my change is wrong, but there may be other modules that depend on the old behaviour. The change only involved s/die/warn/ in one place, so it's easily undone.Hmm, I don't know the right thing to do here. What module was it that didn't work? I'm inclined to keep it the same and get that module fixed.
The rest of the changes involve the test script, and it's really messy. I don't think that I broke anything for any other platform, but it really needs a cleaner solution. Maybe someone here can suggest a way to use MakeMaker to construct the correct commands for compiling and linking the test XS file???I'm not sure MakeMaker opens up this part of its API for public use, but maybe someone else knows otherwise. I've attached the patch as I'll apply it. It passes on Mac OS X 10.2.3. If it looks good to you, I'll upload 1.99_01 to CPAN and try to get bunches of people to test it before declaring it 2.00.
(I'd also like to fix the "Use of uninitialized value in join or string at /Users/ken/src/modules/ExtUtils-ParseXS/blib/lib/ExtUtils/ParseXS.pm line 798, <File0000> line 14" error before 2.00, but I don't know what's causing it.)
-Ken
patch
Description: Binary data
