"Gregory M. Turner" gmturner007@ameritech.net writes:
Let me know what you think of these. So far, I like them better than the original versions, although in solving some limitations of the old macros, I've created some new ones.
Of course the main limitation is that this requires gcc, which means the macros can't be used in Wine itself. They might be useful for Winelib apps though.
Otherwise, these are better macros. They are slightly more easily understood (although still pretty darn confusing, especially in the debugger), probably more resiliant against compiler optimizations, and have much less awful performance. Best of all, they ought to properly re-raise exceptions after executing finally clauses.
You cannot re-raise exceptions after finally, the finally block has to run at unwind time, not from the exception filter. You should probably use the existing __FINALLY macro for that.
Sooo.... Anyone want to help me decide what's the best way to get a thread-local global variable instantiated? Probably, my previous attempt with TlsAlloc was semantically correct, but that was /way/ too fat a solution, I'd like something much quicker if its at all possible.
IMO you shouldn't use a variable at all, you should do everything on the stack. Otherwise it won't work when an exception happens in the middle of the exception code.