On Sat, Oct 28, 2023 at 05:59:28PM +0100, Jonathan Cameron wrote: > #define scoped_cond_guard_call(_name, _call, args...) \ > + for (CLASS(_name, scope)(args), \ > + *done = NULL; !done; done = (void *)1) \ > + if (!__guard_ptr(_name)(&scope)) _call; \ > + else > > Totally untested but hopefully conveys the idea (which is a tiny > extension of your scoped_cond_guard) It's a statement not a call, but yeah, I've done something like this, even made one of my cases simpler too, Let me got post this stuff so we can get it merged.