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 !PERL_IMPLICIT_CONTEXT, the second half is for PERL_IMPLICIT_CONTEXT. Since 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.
If you ask me, that's worth to perlbug to p5p. The Perl API manpage advertises newSVpvf, so either it or embed.h should get fixed. Could you do it? You could just post it as a question to p5p first.
But regardless, we now use the Perl_ version, so we are good. I just want to see that fixed for the future, so we don't have to waste cycles every time, this buglet is forgotten.
Thanks.
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]