move since from inclrtl to std/private/since (#14188)
* move since from inclrtl to std/private/since * move since import in system below for HCR
This commit is contained in:
parent
3be669be32
commit
fbc97e712a
27 changed files with 60 additions and 59 deletions
|
|
@ -48,21 +48,3 @@ when defined(nimlocks):
|
|||
{.pragma: benign, gcsafe, locks: 0.}
|
||||
else:
|
||||
{.pragma: benign, gcsafe.}
|
||||
|
||||
template isSince(version: (int, int)): bool =
|
||||
(NimMajor, NimMinor) >= version
|
||||
template isSince(version: (int, int, int)): bool =
|
||||
(NimMajor, NimMinor, NimPatch) >= version
|
||||
|
||||
template since(version, body: untyped) {.dirty, used.} =
|
||||
## Usage:
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## proc fun*() {since: (1, 3).}
|
||||
## proc fun*() {since: (1, 3, 1).}
|
||||
##
|
||||
## Limitation: can't be used to annotate a template (eg typetraits.get), would
|
||||
## error: cannot attach a custom pragma.
|
||||
# `dirty` needed because `NimMajor` may not yet be defined in caller.
|
||||
when isSince(version):
|
||||
body
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue