fix doccomment of macros.get{Size,Align,Offset} [ci skip] (#11346)
This commit is contained in:
parent
9d8b4d6020
commit
35593700fa
1 changed files with 12 additions and 7 deletions
|
|
@ -1596,12 +1596,17 @@ proc getProjectPath*(): string = discard
|
||||||
|
|
||||||
when defined(nimMacrosSizealignof):
|
when defined(nimMacrosSizealignof):
|
||||||
proc getSize*(arg: NimNode): int {.magic: "NSizeOf", noSideEffect.} =
|
proc getSize*(arg: NimNode): int {.magic: "NSizeOf", noSideEffect.} =
|
||||||
## Returns the same result as ``system.sizeof``, but it works on
|
## Returns the same result as ``system.sizeof`` if the size is
|
||||||
## ``NimNode`` for use in macro context.
|
## 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.} =
|
proc getAlign*(arg: NimNode): int {.magic: "NSizeOf", noSideEffect.} =
|
||||||
## Returns the same result as ``system.alignof``, but it works on
|
## Returns the same result as ``system.alignof`` if the alignment
|
||||||
## ``NimNode`` for use in macro context.
|
## 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.} =
|
proc getOffset*(arg: NimNode): int {.magic: "NSizeOf", noSideEffect.} =
|
||||||
## Returns the same result as ``system.offsetof``, but it expects
|
## Returns the same result as ``system.offsetof`` if the offset is
|
||||||
## a resolved symbol node from a field of a type. Therefore it
|
## known by the Nim compiler. It expects a resolved symbol node
|
||||||
## only requires one argument instead of two.
|
## 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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue