From 40f184e52b2903b7ff1caed5c104b9d84e2f0d52 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sat, 25 Feb 2023 12:50:08 +0100 Subject: Some clever adjustment to coroutine state. --- include/stc/algo/coroutine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/stc/algo/coroutine.h b/include/stc/algo/coroutine.h index b7ed895f..2ac17744 100644 --- a/include/stc/algo/coroutine.h +++ b/include/stc/algo/coroutine.h @@ -66,9 +66,9 @@ int main(void) { case 0: #define cco_end() \ - break; \ + *_state = 0; break; \ default: assert(!"missing cco_final: or illegal state"); \ - } *_state = -2 + } *_state *= -1 #define cco_yield(retval) \ do { \ -- cgit v1.2.3