I think the following way looks more simple and also is a bit more correct:
#define __LEAVE_IF_ERR(_c) ((_c >= 0) || (({__BREAKPOINT(); User::Leave(_c);}), 0))
The __BREAKPOINT macro is defined in e32def.h.
Purely out of curiosity: what do these assembly statements do? On Windows and on the target platform. Thanks!
to Tote: int 3 - is the breakpoint.
to Ivey: In you proposal statement _c is executed two times if leave occurs. If you wrap Int32 SomeFunction() to macro then the function would be called twice.
Alones 14:01, 21 August 2007 (UTC)