From d6f52f3cefc8ae8a08309e2e46ad9d46ec6b706d Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 7 Nov 2019 12:02:26 +0100 Subject: [PATCH] added 'since' template for further stdlib additions (cherry picked from commit 372b01711e2a4d3f0672f75aaa0895147b928cfc) --- lib/system/inclrtl.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/system/inclrtl.nim b/lib/system/inclrtl.nim index 4193f2bdd9..6bff819e67 100644 --- a/lib/system/inclrtl.nim +++ b/lib/system/inclrtl.nim @@ -48,3 +48,7 @@ when defined(nimlocks): {.pragma: benign, gcsafe, locks: 0.} else: {.pragma: benign, gcsafe.} + +template since(version, body: untyped) {.dirty.} = + when version <= (NimMajor, NimMinor): + body