[Wireshark-dev] SET_ADDRESS, if-else

2013-09-07 Thread Martin Kaiser
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

Re: [Wireshark-dev] SET_ADDRESS, if-else

2013-09-07 Thread Gerald Combs
On 9/7/13 5:53 AM, Evan Huus wrote: 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. Is there any reason we shouldn't convert the macros in

Re: [Wireshark-dev] SET_ADDRESS, if-else

2013-09-07 Thread Evan Huus
On Sat, Sep 7, 2013 at 12:46 PM, Gerald Combs ger...@wireshark.org wrote: On 9/7/13 5:53 AM, Evan Huus wrote: 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

Re: [Wireshark-dev] SET_ADDRESS, if-else

2013-09-07 Thread Guy Harris
On Sep 7, 2013, at 9:46 AM, Gerald Combs ger...@wireshark.org wrote: On 9/7/13 5:53 AM, Evan Huus wrote: 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