diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-05-28 15:57:27 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-05-28 15:57:27 +0200 |
commit | 35593700fa8639e12a53db25f4cc1a9d67b5ad6d (patch) | |
tree | f5616f826b4afe946ba384966fa47781069a9d77 /lib/core | |
parent | 9d8b4d60206cc31ed87ac69723930d79fa4d2c89 (diff) | |
download | Nim-35593700fa8639e12a53db25f4cc1a9d67b5ad6d.tar.gz |
fix doccomment of macros.get{Size,Align,Offset} [ci skip] (#11346)
Diffstat (limited to 'lib/core')
-rw-r--r-- | lib/core/macros.nim | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index dfda43625..98d1eae8c 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -1596,12 +1596,17 @@ proc getProjectPath*(): string = discard when defined(nimMacrosSizealignof): proc getSize*(arg: NimNode): int {.magic: "NSizeOf", noSideEffect.} = - ## Returns the same result as ``system.sizeof``, but it works on - ## ``NimNode`` for use in macro context. + ## Returns the same result as ``system.sizeof`` if the size is + ## known by the Nim compiler. Returns a negative value if the Nim + ## compiler does not know the size. proc getAlign*(arg: NimNode): int {.magic: "NSizeOf", noSideEffect.} = - ## Returns the same result as ``system.alignof``, but it works on - ## ``NimNode`` for use in macro context. + ## Returns the same result as ``system.alignof`` if the alignment + ## is known by the Nim compiler. It works on ``NimNode`` for use + ## in macro context. Returns a negative value if the Nim compiler + ## does not know the alignment. proc getOffset*(arg: NimNode): int {.magic: "NSizeOf", noSideEffect.} = - ## Returns the same result as ``system.offsetof``, but it expects - ## a resolved symbol node from a field of a type. Therefore it - ## only requires one argument instead of two. + ## Returns the same result as ``system.offsetof`` if the offset is + ## known by the Nim compiler. It expects a resolved symbol node + ## from a field of a type. Therefore it only requires one argument + ## instead of two. Returns a negative value if the Nim compiler + ## does not know the offset. |