Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Dec 31, 2019
1 parent ce40ed1 commit 964dee8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 7 additions & 0 deletions lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3562,6 +3562,13 @@ const
NimVersion*: string = $NimMajor & "." & $NimMinor & "." & $NimPatch
## is the version of Nim as a string.

template since*(version, body: untyped) {.dirty.} =
## Enable `body` when nim >= `version`
##
## .. code-block:: Nim
## proc foo*() {.since: (1, 1).} = discard
when version <= (NimMajor, NimMinor):
body

type
FileSeekPos* = enum ## Position relative to which seek should happen.
Expand Down
4 changes: 0 additions & 4 deletions lib/system/inclrtl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,3 @@ when defined(nimlocks):
{.pragma: benign, gcsafe, locks: 0.}
else:
{.pragma: benign, gcsafe.}

template since(version, body: untyped) {.dirty.} =
when version <= (NimMajor, NimMinor):
body

0 comments on commit 964dee8

Please sign in to comment.