Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jan 3, 2020
1 parent a654163 commit 0d75be9
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 @@ -3568,6 +3568,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 0d75be9

Please sign in to comment.