mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
Generate C code to set coroutine state.
This commit is contained in:
1 parent
bacd2e3b61
commit
8ad82f5e1f
5 files changed
+92
-32
No files matched your search
@@ -9,9 +9,11 @@
|
||||
// Use switch cases for coroutine state, similar to the technique in
|
||||
// https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
|
||||
//
|
||||
// We use a trivial macro instead of an explicit case statement so that
|
||||
// clang-format doesn't get confused by the unusual "case"s.
|
||||
#define PUFFS_COROUTINE_STATE(n) case n:
|
||||
// We use a trivial macro instead of an explicit assignment and case statement
|
||||
// so that clang-format doesn't get confused by the unusual "case"s.
|
||||
#define PUFFS_COROUTINE_STATE(n) \
|
||||
coro_state = n; \
|
||||
case n:
|
||||
|
||||
#define PUFFS_LOW_BITS(x, n) ((x) & ((1 << (n)) - 1))
|
||||
|
||||
|
||||
Reference in new issue
Block a user