mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 06:20:38 +00:00
* [backport] fix #11320 * fix test for 32 bit test
This commit is contained in:
committed by
Andreas Rumpf
parent
0a1cb631a2
commit
20d0ef8afb
@@ -877,8 +877,8 @@ when defined(nimHasalignOf):
|
||||
proc offsetOfDotExpr(typeAccess: typed): int {.magic: "OffsetOf", noSideEffect, compileTime.}
|
||||
|
||||
template offsetOf*[T](t: typedesc[T]; member: untyped): int =
|
||||
var tmp: T
|
||||
offsetOfDotExpr(tmp.member)
|
||||
var tmp {.noinit.}: ptr T
|
||||
offsetOfDotExpr(tmp[].member)
|
||||
|
||||
template offsetOf*[T](value: T; member: untyped): int =
|
||||
offsetOfDotExpr(value.member)
|
||||
|
||||
Reference in New Issue
Block a user