On Tue, Dec 14, 2004 at 03:24:30PM -0500, Stas Bekman wrote:
> Joe Orton wrote:
> >Just make the generated export stub code #ifndef'ed?
> >
> >#ifndef modperl_io_apache_init
> >const void *modperl_hack_io_apache_init = (const void 
> >*)modperl_io_apache_init;
> >#endif
> >
> >if the symbol is a macro then there's no point in generating a stub for
> >it anyway...
> 
> It's not a macro normally, it's a macro only on certain setups. Here it is 
> again:
> 
> #ifdef PERLIO_LAYERS
> MP_INLINE void modperl_io_apache_init(pTHX);
> #else
> #define        modperl_io_apache_init(pTHX)
> #endif
> 
> So that trick of #ifndef, won't work when PERLIO_LAYERS is not defined, 
> right? Since modperl_io_apache_init is always defined but something it's a 
> real symbols at other times it's a macro to keep some compilers happy.

I'm not sure what you're asking; the preprecessor doesn't know about C
function declarations, it only cares about preprocessor directives.  In
the above case, the CPP macro "modperl_io_apache_init" is only defined
in the case that PERLIO_LAYERS is not defined.  So the fragment:

#ifndef modperl_io_apache_init
const void *modperl_hack_io_apache_init = (const void*)modperl_io_apache_init;
#endif

only expands in the case that PERLIO_LAYERS *is* defined, which is the 
desired outcome, right?

joe

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to