diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-11 09:13:56 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-15 15:58:46 -0600 |
commit | 0c48e88c80909eb27c86f17df4ca7d10fd1326b8 (patch) | |
tree | 43f400b853b06e3284aa912deb471afacafec1d9 | |
parent | db9a58f48c6eae16fbfcd89d59b09e123dbed54f (diff) |
libcr_ipc: Fix cr_select_l
-rw-r--r-- | libcr_ipc/include/libcr_ipc/chan.h | 7 | ||||
-rw-r--r-- | libcr_ipc/tests/test_select.c | 5 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libcr_ipc/include/libcr_ipc/chan.h b/libcr_ipc/include/libcr_ipc/chan.h index 5a87643..83a81d4 100644 --- a/libcr_ipc/include/libcr_ipc/chan.h +++ b/libcr_ipc/include/libcr_ipc/chan.h @@ -163,9 +163,10 @@ size_t cr_select_v(size_t arg_cnt, struct cr_select_arg arg_vec[]); /* cr_select_l(arg1, arg2, arg3, ...) ******************************************/ -#define cr_select_l(...) ({ \ - struct cr_select_arg _cr_select_args[] = { __VA_ARGS__ }; \ - cr_select_v(sizeof(_cr_select_args)/sizeof(_cr_select_args[0])); \ +#define cr_select_l(...) ({ \ + struct cr_select_arg _cr_select_args[] = { __VA_ARGS__ }; \ + cr_select_v(sizeof(_cr_select_args)/sizeof(_cr_select_args[0]), \ + _cr_select_args); \ }) #endif /* _LIBCR_IPC_CHAN_H_ */ diff --git a/libcr_ipc/tests/test_select.c b/libcr_ipc/tests/test_select.c index f0a71a3..3da1c78 100644 --- a/libcr_ipc/tests/test_select.c +++ b/libcr_ipc/tests/test_select.c @@ -53,9 +53,8 @@ COROUTINE cr_consumer(void *) { test_assert(ret_arg == 0); send = 890; - args[0] = CR_SELECT_SEND(&fch, &send); - args[1] = CR_SELECT_DEFAULT; - ret_arg = cr_select_v(2, args); + ret_arg = cr_select_l(CR_SELECT_SEND(&fch, &send), + CR_SELECT_DEFAULT); test_assert(ret_arg == 1); cr_end(); |