summaryrefslogtreecommitdiffstats
path: root/5fee743356e035e47d260299b80b99d1b020908c.patch
blob: f28cb0827047b3fe8e758d2d1c14f851be1a102f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 5fee743356e035e47d260299b80b99d1b020908c Mon Sep 17 00:00:00 2001
From: twosee <twose@qq.com>
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);