From: Maria Matejka Date: Sun, 23 Feb 2025 08:01:22 +0000 (+0100) Subject: this is a bad BIRDLOOP_INSIDE macro, don't like it X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmq-flocksim;p=thirdparty%2Fbird.git this is a bad BIRDLOOP_INSIDE macro, don't like it --- diff --git a/lib/io-loop.h b/lib/io-loop.h index c043d1a0f..d3b32e5d6 100644 --- a/lib/io-loop.h +++ b/lib/io-loop.h @@ -61,6 +61,11 @@ void birdloop_leave(struct birdloop *loop); bool birdloop_inside(struct birdloop *loop); +#define BIRDLOOP_INSIDE(_loop) for ( \ + struct birdloop *_loop_inside = (birdloop_inside(_loop) ? (struct birdloop *) 1 : (birdloop_enter(_loop), _loop)); \ + _loop_inside; \ + _loop_inside = ((_loop_inside == _loop) ? (birdloop_leave(_loop_inside), NULL) : NULL)) + void birdloop_mask_wakeups(struct birdloop *loop); void birdloop_unmask_wakeups(struct birdloop *loop);