This repository has been archived on 2021-02-04. You can view files and clone it, but cannot push or open issues or pull requests.
keyboard.old/include/coroutine.h

7 lines
245 B
C

#pragma once
#define CO_BEGIN static unsigned state = 0; switch (state) { case 0:
#define CO_YIELD do { state = __LINE__; return; case __LINE__:; } while (0)
#define CO_BREAK do { state = 0; return; } while (0)
#define CO_END } state = 0