Joe Orton wrote:
On Mon, Dec 13, 2004 at 08:12:19PM -0500, Stas Bekman wrote:
In fact we already somewhat handle that in modperl_io_apache.h
#ifdef PERLIO_LAYERS [...] MP_INLINE void modperl_io_apache_init(pTHX);
#else /* #ifdef PERLIO_LAYERS */
#define modperl_io_apache_init(pTHX)
but for some reason define doesn't do the trick, when it gets to do:
const void *modperl_hack_io_apache_init = (const void *)modperl_io_apache_init;
The C preprocessor won't expand a parameterized macro unless it's called with parameters:
$ cpp #define foo(bar) bar foo(norman) foo blah # 1 "<stdin>" # 1 "<built-in>" # 1 "<command line>" # 1 "<stdin>"
norman foo blah
Thanks Joe. So what kind of hack of the hack can we use here? I suppose that even if it did expand it, there would have been a problem since we have:
#define modperl_io_apache_init(pTHX)
so it expands to nothing. Of course the right solution is to never include this in the autogenerated modperl_exports.c but this will require C parsing with some messy sed like Apache/APR do. Is there some other solution for this kind of functions?
There is already support in the modperl_exports.c generation code to exclude certain functions depending on build options. So in summary, if we just excluded modperl_io_apache_init() from modperl_exports.c when PERLIO is absent, we would be good ? Or is there other modperl_perlio_ or modperl_io_ symbols we should also skip ?
In any case, I've got the code ready to exclude things when under PERLIO, I just want to confirm what we need to exclude. And unless I am wrong, this should also have been a problem to people in the win32 land as well, no ?
-------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
signature.asc
Description: OpenPGP digital signature