At 10:44 PM 7/31/2003, Mahadevan R wrote:
>While trying to write an Apache2 module in C++, I found that in the command table,
>AP_INIT_TAKE1 has to be used like this:
>
>AP_INIT_TAKE1( "Directive", (cmd_func) drctv_handler, NULL, OR_ALL, "help string")
>
>The compiler I'm using (MSVC++ 6.0) does not support "designated initializers". Hence
>the compiler expects the function drctv_handler to have a signature of
>"const char *(*cmd_func) ();" whereas it actually has a signature of
>"const char *(*take1) (cmd_parms *parms, void *mconfig, const char *w);".
>
>The situation can be easily solved (worked around?) by changing the definition of
>AP_INIT_TAKE1 (and its friends) in http_config.h to:
>
># define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
> { directive, (cmd_func) func, mconfig, where, TAKE1, help }
We have a very strong policy against casts at all costs when it will likely
mask a developers error. I would be much more happy to consider a patch
that introduced specific prototypes for the TAKE1_fn, TAKE12_fn, etc
function type declarations.
Bill