On Mon, Mar 10, 2003 at 11:42:50AM +1100, Stas Bekman wrote:
> Tim Bunce wrote:
> >>
> >>static dbistate_t **get_dbistate() {
> >>   return ((dbistate_t**)&SvIVX(DBISTATE_ADDRSV));
> >>}
> >># undef DBIS
> >># define DBIS (*get_dbistate())
> >># define dbis (*get_dbistate()) /* temp for bad drivers using 'dbis' instead of 
> >>'DBIS' */
> >>
> >>it's used but in a peculiar way. Any ideas how to shut this warning?

> >The easiest way might just be a dummy 'use' of get_dbistate:
> >     if (0) (void)get_dbistate();
> 
> this won't do the same job?
> 
> -static dbistate_t **get_dbistate() {
> -    return ((dbistate_t**)&SvIVX(DBISTATE_ADDRSV));
> -}
>  # undef DBIS
> -# define DBIS (*get_dbistate())
> -# define dbis (*get_dbistate()) /* temp for bad drivers using 'dbis' instead of 
> 'DBIS' */
> +# define DBIS (*(dbistate_t**)&SvIVX(DBISTATE_ADDRSV))
> +/* temp for bad drivers using 'dbis' instead of 'DBIS' */
> +# define dbis (*(dbistate_t**)&SvIVX(DBISTATE_ADDRSV))

I'm not sure. Looks like it ought to, and it leaves DBIS as an
lvalue, which it needs to be.

Can anyone test it on ActiveState windows perl for me?

Tim.

Reply via email to