aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPaul Gilbert2012-05-13 18:19:40 +1000
committerPaul Gilbert2012-05-17 20:47:02 +1000
commitbd5b65f0071ecb907a8930cff8e91e565b990fb9 (patch)
tree7867de2a125b1f90144fe4731e85621686b9f6af /common
parent68b0412ce983899eab8dc0ce45debf17da37eba5 (diff)
downloadscummvm-rg350-bd5b65f0071ecb907a8930cff8e91e565b990fb9.tar.gz
scummvm-rg350-bd5b65f0071ecb907a8930cff8e91e565b990fb9.tar.bz2
scummvm-rg350-bd5b65f0071ecb907a8930cff8e91e565b990fb9.zip
COMMON: Fix compilation of coroutines code when COROUTINE_DEBUG is defined
Diffstat (limited to 'common')
-rw-r--r--common/coroutines.cpp9
-rw-r--r--common/coroutines.h4
2 files changed, 8 insertions, 5 deletions
diff --git a/common/coroutines.cpp b/common/coroutines.cpp
index 5a2baccfae..d511ab4b35 100644
--- a/common/coroutines.cpp
+++ b/common/coroutines.cpp
@@ -21,6 +21,9 @@
#include "common/coroutines.h"
#include "common/algorithm.h"
+#include "common/debug.h"
+#include "common/hashmap.h"
+#include "common/hash-str.h"
#include "common/system.h"
#include "common/textconsole.h"
@@ -32,7 +35,7 @@ CoroContext nullContext = NULL;
DECLARE_SINGLETON(CoroutineScheduler);
-#if COROUTINE_DEBUG
+#ifdef COROUTINE_DEBUG
namespace {
static int s_coroCount = 0;
@@ -64,7 +67,7 @@ static void displayCoroStats() {
CoroBaseContext::CoroBaseContext(const char *func)
: _line(0), _sleep(0), _subctx(0) {
-#if COROUTINE_DEBUG
+#ifdef COROUTINE_DEBUG
_funcName = func;
changeCoroStats(_funcName, +1);
s_coroCount++;
@@ -72,7 +75,7 @@ CoroBaseContext::CoroBaseContext(const char *func)
}
CoroBaseContext::~CoroBaseContext() {
-#if COROUTINE_DEBUG
+#ifdef COROUTINE_DEBUG
s_coroCount--;
changeCoroStats(_funcName, -1);
debug("Deleting coro in %s at %p (subctx %p)",
diff --git a/common/coroutines.h b/common/coroutines.h
index 80748e352d..fed82bf3f9 100644
--- a/common/coroutines.h
+++ b/common/coroutines.h
@@ -43,7 +43,7 @@ namespace Common {
// Enable this macro to enable some debugging support in the coroutine code.
-//#define COROUTINE_DEBUG 1
+//#define COROUTINE_DEBUG
/**
* The core of any coroutine context which captures the 'state' of a coroutine.
@@ -53,7 +53,7 @@ struct CoroBaseContext {
int _line;
int _sleep;
CoroBaseContext *_subctx;
-#if COROUTINE_DEBUG
+#ifdef COROUTINE_DEBUG
const char *_funcName;
#endif
CoroBaseContext(const char *func);