summaryrefslogtreecommitdiffhomepage
path: root/include/stc/coroutine.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-08-08 12:28:15 +0200
committerTyge Løvset <[email protected]>2023-08-08 15:57:25 +0200
commitc27c266b6c4ae0e5e535b18c3790ee97416412b9 (patch)
tree0b73c9cf644486abbc9213f98c1c308b7511c7dc /include/stc/coroutine.h
parent9e13d34c82abfeeadcc8697331f9fd3e5e7f2bca (diff)
downloadSTC-modified-c27c266b6c4ae0e5e535b18c3790ee97416412b9.tar.gz
STC-modified-c27c266b6c4ae0e5e535b18c3790ee97416412b9.zip
Reverted cco_cleanup => cco_final. (cco_cleanup deprecated).
Updated generator.c example. Misc internal refactoring.
Diffstat (limited to 'include/stc/coroutine.h')
-rw-r--r--include/stc/coroutine.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/stc/coroutine.h b/include/stc/coroutine.h
index 0e592bae..cecd4002 100644
--- a/include/stc/coroutine.h
+++ b/include/stc/coroutine.h
@@ -38,7 +38,7 @@ int iterpair(struct iterpair* I) {
for (I->y = 0; I->y < I->max_y; I->y++)
cco_yield();
- cco_cleanup: // required if there is cleanup code
+ cco_final: // required if there is cleanup code
puts("final");
}
return 0; // CCO_DONE
@@ -103,7 +103,8 @@ typedef enum {
/* cco_blocking_call(): assumes coroutine returns a cco_result value (int) */
#define cco_blocking_call(corocall) while ((corocall) != CCO_DONE)
-#define cco_cleanup \
+#define cco_cleanup cco_final // [deprecated]
+#define cco_final \
*_state = CCO_STATE_CLEANUP; case CCO_STATE_CLEANUP
#define cco_return \