diff options
| author | Tyge Løvset <[email protected]> | 2023-05-24 14:38:54 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-24 14:38:54 +0200 |
| commit | 8a19b4d6ff098ec014244c86569a7bea2db65514 (patch) | |
| tree | 9d9e2c6878f56552e35de9273c76766cfe229fb4 /misc/examples | |
| parent | 00150a367c1e50c6b68ab878043beb6c1c8baa02 (diff) | |
| parent | 6973d104999f47e0baad4b23d36642f86775be90 (diff) | |
| download | STC-modified-8a19b4d6ff098ec014244c86569a7bea2db65514.tar.gz STC-modified-8a19b4d6ff098ec014244c86569a7bea2db65514.zip | |
Merge pull request #57 from liigo/dev43
add `cco` macro, block style coroutine definition
Diffstat (limited to 'misc/examples')
| -rw-r--r-- | misc/examples/coread.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/examples/coread.c b/misc/examples/coread.c index e60fb31c..1976231f 100644 --- a/misc/examples/coread.c +++ b/misc/examples/coread.c @@ -13,7 +13,7 @@ struct file_read { void file_read(struct file_read* g) { - cco_begin(g) + cco(g) { g->fp = fopen(g->filename, "r"); g->line = cstr_init(); @@ -23,7 +23,8 @@ void file_read(struct file_read* g) printf("finish\n"); cstr_drop(&g->line); fclose(g->fp); - cco_end(); + } + return; } int main(void) |
