diff options
author | Araq <rumpf_a@web.de> | 2014-08-11 20:38:28 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-08-11 20:38:28 +0200 |
commit | dd806cafa0193acb9e79fdd47ec6810da3c48272 (patch) | |
tree | b42f7aacdd844e9402a3308e363f71e14db8b78a /lib/pure/nimprof.nim | |
parent | b1c8461a3b738cb4383b2e23ba24f36960a8604c (diff) | |
download | Nim-dd806cafa0193acb9e79fdd47ec6810da3c48272.tar.gz |
distinguish between 'defined' and 'declared'
Diffstat (limited to 'lib/pure/nimprof.nim')
-rw-r--r-- | lib/pure/nimprof.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/nimprof.nim b/lib/pure/nimprof.nim index ab7cd1944..6f94d0656 100644 --- a/lib/pure/nimprof.nim +++ b/lib/pure/nimprof.nim @@ -26,7 +26,7 @@ const withThreads = compileOption("threads") tickCountCorrection = 50_000 -when not defined(system.TStackTrace): +when not declared(system.TStackTrace): type TStackTrace = array [0..20, cstring] # We use a simple hash table of bounded size to keep track of the stack traces: @@ -146,7 +146,7 @@ proc `//`(a, b: int): string = result = format("$1/$2 = $3%", a, b, formatFloat(a / b * 100.0, ffDefault, 2)) proc writeProfile() {.noconv.} = - when defined(system.TStackTrace): + when declared(system.TStackTrace): system.profilerHook = nil const filename = "profile_results.txt" echo "writing " & filename & "..." @@ -189,16 +189,16 @@ var disabled: int proc disableProfiling*() = - when defined(system.TStackTrace): + when declared(system.TStackTrace): atomicDec disabled system.profilerHook = nil proc enableProfiling*() = - when defined(system.TStackTrace): + when declared(system.TStackTrace): if atomicInc(disabled) >= 0: system.profilerHook = hook -when defined(system.TStackTrace): +when declared(system.TStackTrace): system.profilerHook = hook addQuitProc(writeProfile) |