diff --git a/include/xemmai/fiber.h b/include/xemmai/fiber.h index 2641ff8..cbe6277 100644 --- a/include/xemmai/fiber.h +++ b/include/xemmai/fiber.h @@ -18,15 +18,6 @@ struct t_fiber { struct t_internal { -#ifdef _WIN32 - static void CALLBACK f_start(PVOID a_f) - { - t_object* bottom = nullptr; - v_current->v_stack_bottom = ⊥ - reinterpret_cast(a_f)(); - } -#endif - t_internal* v_next; void* v_thread; t_fiber* v_fiber; diff --git a/src/fiber.cc b/src/fiber.cc index 78780be..404a126 100644 --- a/src/fiber.cc +++ b/src/fiber.cc @@ -77,7 +77,12 @@ t_fiber::t_internal::t_internal(t_fiber* a_fiber, void(*a_f)()) : t_internal(a_f t_fiber::t_internal::t_internal(t_fiber* a_fiber, void(*a_f)()) : t_internal(a_fiber->v_stack, 2) { v_fiber = a_fiber; - v_handle = CreateFiber(0, f_start, a_f); + v_handle = CreateFiber(0, [](PVOID a_f) + { + t_object* bottom = nullptr; + v_current->v_stack_bottom = ⊥ + reinterpret_cast(a_f)(); + }, a_f); } #endif