|
|
|
|
|
by HeliumHydride
433 days ago
|
|
With GNU extensions, you can make a simpler coroutine macro without switch/case abuse: #define CO_BEGIN static void* cr_state_ = &&cr_st_0; goto *cr_state_; cr_st_0:
#define CO_RETURN(x) ({ __label__ resume; cr_state_ = &&resume; return (x); resume:; })
|
|