From 0d75be9dcd06c489fcfb8f24e9231fe402cb776d Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Tue, 31 Dec 2019 06:58:07 -0800 Subject: [PATCH] fix #12996 --- lib/system.nim | 7 +++++++ lib/system/inclrtl.nim | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) 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