summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/stc/coroutine.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/stc/coroutine.h b/include/stc/coroutine.h
index 9f55dddf..7917878a 100644
--- a/include/stc/coroutine.h
+++ b/include/stc/coroutine.h
@@ -132,7 +132,19 @@ typedef enum {
(void)((co)->cco_state = 0)
/*
- * Tasks (optional)
+ * Generators
+ */
+
+#define cco_generator(Name, ...) \
+ typedef Name Name##_value; \
+ typedef struct { \
+ Name##_value* ref; \
+ int cco_state; \
+ __VA_ARGS__ \
+ } Name##_iter
+
+/*
+ * Tasks
*/
struct cco_runtime;