summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-05-28 15:57:27 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-05-28 15:57:27 +0200
commit35593700fa8639e12a53db25f4cc1a9d67b5ad6d (patch)
treef5616f826b4afe946ba384966fa47781069a9d77 /lib
parent9d8b4d60206cc31ed87ac69723930d79fa4d2c89 (diff)
downloadNim-35593700fa8639e12a53db25f4cc1a9d67b5ad6d.tar.gz
fix doccomment of macros.get{Size,Align,Offset} [ci skip] (#11346)
Diffstat (limited to 'lib')
-rw-r--r--lib/core/macros.nim19
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.