On Sat, Sep 7, 2013 at 6:16 AM, Martin Kaiser <[email protected]> wrote:
> Hi,
>
> I just found that
>
> if (...)
> SET_ADDRESS(...);
> else
> SET_ADDRESS(...);
>
> does not compile as this would expand to
>
> if (...)
> {
> };
> else
> {
> }
>
> and the compiler complains about else without if.
>
> Is there anything useful we could do about this other that putting
> another pair of brackets around the first SET_ADDRESS?
>
The usual trick in this situation is to wrap the macro in a "do { MY CODE }
while (0)" so that it behaves syntactically like a normal function call. I
have done this in r51819, so it should work now.
Cheers,
Evan
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <[email protected]>
Archives: http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:[email protected]?subject=unsubscribe