perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wichitill <>
Subject Re: [mp2] t/modperl/util hangs on Linux
Date Thu, 16 Dec 2004 00:52:52 GMT
Stas Bekman wrote:
> Markus Wichitill wrote:
>> Well, I haven't written any C/C++ in a while and I've never had to 
>> deal with macro hell, but as far as I can see, newSVpvf is defined in 
>> Perl's embed.h:
>> #define newSVpvf        Perl_newSVpvf
>> If I add that line to the top of ModPerl__Util.h manually, it works. 
>> If I add
>> #ifndef newSVpvf
>> #error newSVpvf not defined
>> #endif
>> to the end of embed.h and compile, it seems that newSVpvf doesn't get 
>> defined. But I have no idea how to trace through that horrible, 
>> generated #ifdef jungle.

Ok, so embed.h mostly consists of two halves, the first half is for 
I have it defined, the aforementioned "#define newSVpvf Perl_newSVpvf" in 
the first half isn't used, and in the second half there's no macro for newSVpvf.

Then there's a few special macros at the bottom of embed.h, one section with 
the comment "varargs functions can't be handled with CPP macros". But the 
workaround macro "#  define newSVpvf Perl_newSVpvf_nocontext" (note the 
misplaced (?) spaces in #define) isn't used either, since I have PERL_CORE 
defined. If I remove the PERL_CORE check, the code compiles and the macro 
used, but the test fails with some garbage output, which is probably ok 
since I don't think the _nocontext version is the right one when you pass 
that aTHX_ thingy (but what do I know).

Anyway, unless you can see the difference between our setups from my 
description, just use the explicit Perl_ prefix for vararg functions. Doug 
did that, too, in Apache__Access.h.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message