apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: Creative solution to a lack of recursive #define's?
Date Sat, 26 Apr 2003 16:11:37 GMT
William A. Rowe, Jr. wrote:

> I'm attempting to come up with some more clever tracing semantics.
> One thing I would like out of the user's foo_hook_method() invocation
> is the stringized 'name' of their hook entry point.  Seems I hit a wall.
> Right now, apr_hooks uses the global 'apr_hook_debug_current'
> pointer to track which module is registering hooks.  Mostly painless
> for the usual cases, since Apache sets up that pointer as it invokes
> a module's register_hooks() entry point.  But if a hook is registered
> outside of that function, whoa boy.

Why does thuis happen?

> Anyways, since the recursive #defines below don't work, and we don't
> want the hook implementor to have to go through any 'extra' hoops,
> does anyone have some thoughts on the fragment below for stringizing
> the entry point 'pf's name?
> #define ns##_hook_##name(pf, aszPre, aszSucc, nOrder) \
>     (ns##_hook_##name)(pf, aszPre, aszSucc, nOrder, #pf)

Surely you can't do this???



http://www.apache-ssl.org/ben.html       http://www.thebunker.net/

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

View raw message