Skip to content

Commit

Permalink
retain Nim 1.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Sep 10, 2024
1 parent d75a5cb commit 1479ae0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions chronicles.nim
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ macro logScopeIMPL(prevScopes: typed,
result.add chroniclesExportNode

let activeScope = id("activeChroniclesScope", isPublic)
result.add quote do:
template `activeScope` {.redefine, used.} =
`newRevision`
`newAssingments`
when NimMajor >= 2:
result.add quote do:
template `activeScope` {.redefine, used.} =
`newRevision`
`newAssingments`
else:
result.add quote do:
template `activeScope` {.used.} =
`newRevision`
`newAssingments`

template logScope*(newBindings: untyped) {.dirty.} =
bind bindSym, logScopeIMPL, brForceOpen
Expand Down

0 comments on commit 1479ae0

Please sign in to comment.