summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/kit/async_function.h10
-rw-r--r--source/test/unittests/async_function.test.c2
2 files changed, 4 insertions, 8 deletions
diff --git a/source/kit/async_function.h b/source/kit/async_function.h
index 3954aca..58d432c 100644
--- a/source/kit/async_function.h
+++ b/source/kit/async_function.h
@@ -48,10 +48,7 @@ typedef struct {
__VA_ARGS__ \
}
-#define KIT_AF_NAME(name_) name_##_coro_
-
-#define KIT_AF_DECL(name_) \
- void KIT_AF_NAME(name_)(void *self_void_, int request_)
+#define KIT_AF_DECL(name_) void name_(void *self_void_, int request_)
#define KIT_CORO_IMPL(name_) \
KIT_AF_DECL(name_) { \
@@ -151,8 +148,8 @@ typedef struct {
#define KIT_AF_TYPE(coro_) struct coro_##_coro_state_
-#define KIT_AF_INITIAL(coro_) \
- ._index = 0, ._state_machine = KIT_AF_NAME(coro_), \
+#define KIT_AF_INITIAL(coro_) \
+ ._index = 0, ._state_machine = (coro_), \
._context = { .state = NULL, .execute = NULL }
#define KIT_AF_CREATE(promise_, coro_, ...) \
@@ -277,7 +274,6 @@ typedef struct {
# define AF_STATE_DATA KIT_AF_STATE_DATA
# define AF_INTERNAL KIT_AF_INTERNAL
# define AF_STATE KIT_AF_STATE
-# define AF_NAME KIT_AF_NAME
# define AF_DECL KIT_AF_DECL
# define CORO_IMPL KIT_CORO_IMPL
# define CORO_END KIT_CORO_END
diff --git a/source/test/unittests/async_function.test.c b/source/test/unittests/async_function.test.c
index 5816bfc..6e1bc69 100644
--- a/source/test/unittests/async_function.test.c
+++ b/source/test/unittests/async_function.test.c
@@ -93,7 +93,7 @@ TEST("coroutine init") {
TEST("coroutine init explicit") {
AF_TYPE(test_foo) promise;
- AF_INIT_EXPLICIT(promise, sizeof promise, AF_NAME(test_foo));
+ AF_INIT_EXPLICIT(promise, sizeof promise, test_foo);
REQUIRE(!AF_FINISHED(promise));
}