You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by "Philippe M. Chiasson" <go...@cpan.org> on 2002/12/12 22:00:16 UTC

[Patch] modperl_module.c broken

Latest changes to modperl_module.c don't build for me at this moment.

Following patch fixes it.

Index: src/modules/perl/modperl_module.c
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_module.c,v
retrieving revision 1.9
diff -b -B -u -r1.9 modperl_module.c
--- src/modules/perl/modperl_module.c	12 Dec 2002 10:12:41 -0000	1.9
+++ src/modules/perl/modperl_module.c	12 Dec 2002 20:58:08 -0000
@@ -154,6 +154,16 @@
         *add  = (modperl_module_cfg_t *)addv;
     
     /* if the module is loaded in vhost, base==NULL */
+    server_rec *s;
+    
+    int is_startup;
+    PTR_TBL_t *table;
+    SV *mrg_obj, *base_obj, *add_obj;
+    
+#ifdef USE_ITHREADS
+    modperl_interp_t *interp;
+    dTHX;
+#endif
     tmp = (base && base->server) ? base : add;
 
     if (tmp && !tmp->server) {
@@ -161,18 +171,18 @@
         return basev;
     }
     
-    server_rec *s = tmp->server;
-    int is_startup = (p == s->process->pconf);
+    s = tmp->server;
+    is_startup = (p == s->process->pconf);
 
 #ifdef USE_ITHREADS
-    modperl_interp_t *interp = modperl_interp_pool_select(p, s);
-    dTHXa(interp->perl);
+    interp = modperl_interp_pool_select(p, s);
+    aTHX = interp->perl;
 #endif
 
-    PTR_TBL_t *table = modperl_module_config_table_get(aTHX_ TRUE);
-    SV *mrg_obj = Nullsv,
-        *base_obj = modperl_svptr_table_fetch(aTHX_ table, base),
-        *add_obj  = modperl_svptr_table_fetch(aTHX_ table, add);
+    table = modperl_module_config_table_get(aTHX_ TRUE);
+    mrg_obj = Nullsv;
+    base_obj = modperl_svptr_table_fetch(aTHX_ table, base);
+    add_obj  = modperl_svptr_table_fetch(aTHX_ table, add);
 
     if (!base_obj || (base_obj == add_obj)) {
         return addv;
@@ -334,6 +344,14 @@
         (modperl_module_cmd_data_t *)cmd->cmd_data;
     modperl_module_info_t *minfo = MP_MODULE_INFO(info->modp);
     modperl_module_cfg_t *srv_cfg;
+    SV *obj = Nullsv;
+    int count;
+    PTR_TBL_t *table;
+#ifdef USE_ITHREADS
+    modperl_interp_t *interp;
+    dTHX;
+    dSP;
+#endif
 
    if (s->is_virtual) {
         MP_dSCFG(s);
@@ -372,14 +390,12 @@
     }
     
 #ifdef USE_ITHREADS
-    modperl_interp_t *interp = modperl_interp_pool_select(p, s);
-    dTHXa(interp->perl);
+    interp = modperl_interp_pool_select(p, s);
+    aTHX = interp->perl;
 #endif
 
-    int count;
-    PTR_TBL_t *table = modperl_module_config_table_get(aTHX_ TRUE);
-    SV *obj = Nullsv;
-    dSP;
+    table = modperl_module_config_table_get(aTHX_ TRUE);
+
 
     errmsg = modperl_module_config_get_obj(aTHX_ p, table, cfg, info,
                                            minfo->dir_create,
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5
(122FF51B/C634E37B)
http://gozer.ectoplasm.org/    F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so
ingenious.
perl
-e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'

Re: [Patch] modperl_module.c broken

Posted by Stas Bekman <st...@stason.org>.
Philippe M. Chiasson wrote:
> Latest changes to modperl_module.c don't build for me at this moment.
> 
> Following patch fixes it.

Ah, silly me, applied with some tweaks (minimizing changes). Thanks.

That's said, gcc-3.2.1 didn't complain about declarations coming after the 
code in the same block. So assume that by default this version allows the 
latest ansi C extensions, where the declarations can come anywhere in the 
code. What gcc flags do you use so you caught this problem?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org