dougm 01/10/22 10:20:11 Modified: lib/ModPerl WrapXS.pm src/modules/perl modperl_config.c modperl_config.h Log: wrap all references to &perl_module inside macros that are redefined to call functions in .xs modules under WIN32 to avoid referencing &perl_module outside of libmodperl.so Revision Changes Path 1.33 +3 -2 modperl-2.0/lib/ModPerl/WrapXS.pm Index: WrapXS.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- WrapXS.pm 2001/10/22 02:43:18 1.32 +++ WrapXS.pm 2001/10/22 17:20:11 1.33 @@ -410,7 +410,8 @@ my($self, $module, $functions) = @_; my $fh = $self->open_class_file($module, '.xs'); - print $fh "$self->{noedit_warning_c}\n"; + print $fh "$self->{noedit_warning_c}\n", + "\n#define MP_IN_XS\n\n"; my @includes = @{ $self->includes }; @@ -652,7 +653,7 @@ sub export_file_header_def { my $self = shift; - "LIBRARY\n\nEXPORTS\n\nperl_module\n"; + "LIBRARY\n\nEXPORTS\n\n"; } sub export_file_format_def { 1.44 +10 -0 modperl-2.0/src/modules/perl/modperl_config.c Index: modperl_config.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- modperl_config.c 2001/09/28 20:08:34 1.43 +++ modperl_config.c 2001/10/22 17:20:11 1.44 @@ -223,6 +223,16 @@ return mrg; } +void *modperl_get_perl_module_config(ap_conf_vector_t *cv) +{ + return ap_get_module_config(cv, &perl_module); +} + +void modperl_set_perl_module_config(ap_conf_vector_t *cv, void *cfg) +{ + ap_set_module_config(cv, &perl_module, cfg); +} + int modperl_config_apply_PerlModule(server_rec *s, modperl_config_srv_t *scfg, PerlInterpreter *perl, apr_pool_t *p) 1.29 +28 -11 modperl-2.0/src/modules/perl/modperl_config.h Index: modperl_config.h =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- modperl_config.h 2001/10/11 15:38:23 1.28 +++ modperl_config.h 2001/10/22 17:20:11 1.29 @@ -20,33 +20,50 @@ #define modperl_config_srv_argv_push(arg) \ *(const char **)apr_array_push(scfg->argv) = arg +void *modperl_get_perl_module_config(ap_conf_vector_t *cv); +void modperl_set_perl_module_config(ap_conf_vector_t *cv, void *cfg); + +#if defined(MP_IN_XS) && defined(WIN32) +# define modperl_get_module_config(v) \ + modperl_get_perl_module_config(v) + +# define modperl_set_module_config(v, c) \ + modperl_set_perl_module_config(v, c) +#else +# define modperl_get_module_config(v) \ + ap_get_module_config(v, &perl_module) + +# define modperl_set_module_config(v, c) \ + ap_set_module_config(v, &perl_module, c) +#endif + #define modperl_config_req_init(r, rcfg) \ if (!rcfg) { \ rcfg = modperl_config_req_new(r); \ - ap_set_module_config(r->request_config, &perl_module, rcfg); \ + modperl_set_module_config(r->request_config, rcfg); \ } #define modperl_config_req_get(r) \ - (r ? (modperl_config_req_t *) \ - ap_get_module_config(r->request_config, &perl_module) : NULL) + (r ? (modperl_config_req_t *) \ + modperl_get_module_config(r->request_config) : NULL) #define MP_dRCFG \ - modperl_config_req_t *rcfg = modperl_config_req_get(r) + modperl_config_req_t *rcfg = modperl_config_req_get(r) #define modperl_config_dir_get(r) \ - (r ? (modperl_config_dir_t *) \ - ap_get_module_config(r->per_dir_config, &perl_module) : NULL) + (r ? (modperl_config_dir_t *) \ + modperl_get_module_config(r->per_dir_config) : NULL) #define modperl_config_dir_get_defaults(s) \ - (modperl_config_dir_t *) \ - ap_get_module_config(s->lookup_defaults, &perl_module) + (modperl_config_dir_t *) \ + modperl_get_module_config(s->lookup_defaults) #define MP_dDCFG \ - modperl_config_dir_t *dcfg = modperl_config_dir_get(r) + modperl_config_dir_t *dcfg = modperl_config_dir_get(r) #define modperl_config_srv_get(s) \ - (modperl_config_srv_t *) \ - ap_get_module_config(s->module_config, &perl_module) + (modperl_config_srv_t *) \ + modperl_get_module_config(s->module_config) #define MP_dSCFG(s) \ modperl_config_srv_t *scfg = modperl_config_srv_get(s)