summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-03-06 16:41:22 +0100
committerTyge Løvset <[email protected]>2023-03-06 16:41:22 +0100
commit03ffb83851690e155a65606010052490f8e5a934 (patch)
tree9a30b32c94a0082625b426fa5ef276f1d86e51f5
parenta203314647b5c37c7e40230551457f006ff36cd5 (diff)
downloadSTC-modified-03ffb83851690e155a65606010052490f8e5a934.tar.gz
STC-modified-03ffb83851690e155a65606010052490f8e5a934.zip
Simplify macro calling coroutine from coroutine.
-rw-r--r--include/stc/algo/coroutine.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/stc/algo/coroutine.h b/include/stc/algo/coroutine.h
index 6d502988..59e4cfca 100644
--- a/include/stc/algo/coroutine.h
+++ b/include/stc/algo/coroutine.h
@@ -86,8 +86,10 @@ enum {
#define cco_yield_3(corocall, ctx, retval) \
do { \
*_state = __LINE__; \
- c_PASTE(cco, __LINE__): corocall; if (cco_alive(ctx)) return retval; \
- case __LINE__: if ((ctx)->cco_state >= cco_state_final) goto c_PASTE(cco, __LINE__); \
+ do { \
+ corocall; if (cco_alive(ctx)) return retval; \
+ case __LINE__:; \
+ } while ((ctx)->cco_state >= cco_state_final); \
} while (0)
#define cco_final \