Geoffrey Young wrote:

(apr_port_t)modperl_callback_per_srv(MP_DEFAULT_PORT_HANDLER, rr, MP_HOOK_RUN_FIRST);

discards 'const'. which is not trivial to fix, so I stopped there, removed your change and finished building the project.



So any suggestions to how to fix that?


not the const request_rec *r part, no. I tried playing with a few things but couldn't get anything to compile without warnings. guess my C needs some polishing :)

The first argument to the default_port hook needs to be a function declared as:


apr_port_t modperl_default_port_handler(const request_rec *r)

which is easy, the problem is that inside that function you call: modperl_callback_per_srv(), whose 'request_rec *r' argument is not 'const' and there is not much you can do about it, besides adding modperl_callback_per_srv_c with proto 'const request_rec *r'. Apache has a bunch of these dual functions, e.g. in include/httpd.h:

AP_DECLARE(char *) ap_strchr(char *s, int c);
AP_DECLARE(const char *) ap_strchr_c(const char *s, int c);
AP_DECLARE(char *) ap_strrchr(char *s, int c);
AP_DECLARE(const char *) ap_strrchr_c(const char *s, int c);
AP_DECLARE(char *) ap_strstr(char *s, const char *c);
AP_DECLARE(const char *) ap_strstr_c(const char *s, const char *c);

found with: grep -Ir const . | grep DECLARE | grep '_c('

__________________________________________________________________
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]



Reply via email to