[PATCH] include: Make break out of __TRY blocks work with compiler exceptions.

Stefan Dösinger stefandoesinger at gmx.at
Sun Feb 12 08:59:30 CST 2017


Am 2017-02-12 um 14:36 schrieb Dmitry Timoshkov:
> Stefan Dösinger <stefandoesinger at gmx.at> wrote:
> 
>> +#define __TRY __try { do
>> +#define __EXCEPT(func) while(0); } __except((func)(GetExceptionInformation())) { do
>> +#define __FINALLY(func) while(0); } __finally { (func)(!AbnormalTermination()); }
>> +#define __ENDTRY while(0); }
>> +#define __EXCEPT_PAGE_FAULT while(0); } __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) { do
>> +#define __EXCEPT_ALL while(0); } __except(EXCEPTION_EXECUTE_HANDLER) { do
> 
> Perhaps add another '{' after 'do' and and '}' before 'while(0)' ?
The code that uses these macros has to put a '{' after __TRY/__EXCEPT
and '}' before __EXCEPT, __ENDTRY and __FINALLY, so I don't think it is
needed. If you think it'll make the macros more readable I can add them
though.

Stefan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20170212/44e35090/attachment.sig>


More information about the wine-devel mailing list