From 5fee743356e035e47d260299b80b99d1b020908c Mon Sep 17 00:00:00 2001 From: twosee Date: Sun, 10 Mar 2019 12:18:48 +0800 Subject: [PATCH] Fix #2411 (Build issue on 32-bit). --- include/context.h | 2 +- src/coroutine/base.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/context.h b/include/context.h index 636c35509..2de69c416 100644 --- a/include/context.h +++ b/include/context.h @@ -81,7 +81,7 @@ class Context bool SwapIn(); bool SwapOut(); static void context_func(void* arg); -#ifdef SW_LOG_TRACE_OPEN +#if !defined(SW_NO_USE_ASM_CONTEXT) && defined(SW_LOG_TRACE_OPEN) ssize_t get_stack_usage(); #endif public: diff --git a/src/coroutine/base.cc b/src/coroutine/base.cc index a08294af4..a7dafcaad 100644 --- a/src/coroutine/base.cc +++ b/src/coroutine/base.cc @@ -82,8 +82,8 @@ void Coroutine::close() { on_close(task); } -#ifdef SW_LOG_TRACE_OPEN - swTraceLog(SW_TRACE_CONTEXT, "coroutine#%ld stack memroy use less than %ld bytes.", get_cid(), ctx.get_stack_usage()); +#ifndef SW_NO_USE_ASM_CONTEXT + swTraceLog(SW_TRACE_CONTEXT, "coroutine#%ld stack memory use less than %ld bytes.", get_cid(), ctx.get_stack_usage()); #endif current = origin; coroutines.erase(cid);