diff --git a/lib/system.nim b/lib/system.nim index 838205c57f51..62180f32d104 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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. diff --git a/lib/system/inclrtl.nim b/lib/system/inclrtl.nim index 6bff819e677d..4193f2bdd9bc 100644 --- a/lib/system/inclrtl.nim +++ b/lib/system/inclrtl.nim @@ -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