You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2003/10/14 21:16:37 UTC

cvs commit: httpd-apreq-2/glue/perl/xsbuilder apreq_xs_postperl.h

joes        2003/10/14 12:16:37

  Modified:    glue/perl/xsbuilder apreq_xs_postperl.h
  Log:
  Applied Geoffrey Young's apreq_xs_postperl.h patch to fix -Werror compile errors.
  
  Revision  Changes    Path
  1.17      +5 -3      httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_postperl.h
  
  Index: apreq_xs_postperl.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_postperl.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- apreq_xs_postperl.h	14 Oct 2003 18:53:30 -0000	1.16
  +++ apreq_xs_postperl.h	14 Oct 2003 19:16:37 -0000	1.17
  @@ -186,6 +186,8 @@
   {                                                       \
       char *class = NULL;                                 \
       dXSARGS;                                            \
  +    items = items;  /* -Werror */                       \
  +                                                        \
       /* map environment to package */                    \
                                                           \
       if (strcmp(apreq_env_name, "APACHE2") == 0)         \
  @@ -221,7 +223,6 @@
   {                                                                       \
       dXSARGS;                                                            \
       void *env;                                                          \
  -    apr_pool_t *pool;                                                   \
       const char *data;                                                   \
       apreq_##type##_t *obj;                                              \
                                                                           \
  @@ -277,9 +278,9 @@
                                  const char *val)
   {
       struct apreq_xs_do_arg *d = (struct apreq_xs_do_arg *)data;
  -    void *env = d->env;
       dTHXa(d->perl);
       dSP;
  +
       if (key)
           XPUSHs(sv_2mortal(newSVpv(key,0)));
       else
  @@ -323,9 +324,10 @@
                                                         const char *val)  \
   {                                                                       \
       struct apreq_xs_do_arg *d = (struct apreq_xs_do_arg *)data;         \
  -    void *env = d->env;                                                 \
  +    void *env;                                                          \
       dTHXa(d->perl);                                                     \
       dSP;                                                                \
  +    env = d->env;                                                       \
       if (val) {                                                          \
           apreq_##type##_t *RETVAL =                                      \
                             apreq_value_to_##type(apreq_strtoval(val));   \
  
  
  

Re: cvs commit: httpd-apreq-2/glue/perl/xsbuilder apreq_xs_postperl.h

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> May be you don't need dXSARGS, if you don't use 'items'? It's defined as:
> 
> #define dXSARGS                \
>     dSP; dMARK;            \
>     dAX; dITEMS
> 
> so you can use only those macros that you really need.

ah, I figured there must have been a better way
> 
> The
> 
>   items = items;  /* -Werror */
> 
> workaround is really only useful for autogenerated code, which has no 
> idea if items is needed or not.

well, I got the idea from Apache.xs in mp1, which uses this kind of 
workaround a lot (and isn't autogenerated :)  but you're probably right :)

--Geoff


Re: cvs commit: httpd-apreq-2/glue/perl/xsbuilder apreq_xs_postperl.h

Posted by Stas Bekman <st...@stason.org>.
joes@apache.org wrote:
> joes        2003/10/14 12:16:37
> 
>   Modified:    glue/perl/xsbuilder apreq_xs_postperl.h
>   Log:
>   Applied Geoffrey Young's apreq_xs_postperl.h patch to fix -Werror compile errors.
>   
>   Revision  Changes    Path
>   1.17      +5 -3      httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_postperl.h
>   
>   Index: apreq_xs_postperl.h
>   ===================================================================
>   RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_postperl.h,v
>   retrieving revision 1.16
>   retrieving revision 1.17
>   diff -u -r1.16 -r1.17
>   --- apreq_xs_postperl.h	14 Oct 2003 18:53:30 -0000	1.16
>   +++ apreq_xs_postperl.h	14 Oct 2003 19:16:37 -0000	1.17
>   @@ -186,6 +186,8 @@
>    {                                                       \
>        char *class = NULL;                                 \
>        dXSARGS;                                            \
>   +    items = items;  /* -Werror */                       \
>   +                                                        \

May be you don't need dXSARGS, if you don't use 'items'? It's defined as:

#define dXSARGS				\
	dSP; dMARK;			\
	dAX; dITEMS

so you can use only those macros that you really need.

The

   items = items;  /* -Werror */

workaround is really only useful for autogenerated code, which has no idea if 
items is needed or not.

__________________________________________________________________
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