Fix a strange build issue, manifesting only in certain contexts

This commit is contained in:
Zahary Karadjov 2019-07-10 20:17:05 +03:00
commit 26e4f63c57
No known key found for this signature in database
GPG key ID: C8936F8A3073D609

View file

@ -7,7 +7,7 @@ type
startOffset: int startOffset: int
OutputStream* = object of RootObj OutputStream* = object of RootObj
cursor: WriteCursor cursor*: WriteCursor
pages: Deque[OutputPage] pages: Deque[OutputPage]
endPos: int endPos: int
vtable*: ptr OutputStreamVTable vtable*: ptr OutputStreamVTable
@ -285,7 +285,8 @@ proc append*(c: var WriteCursor, chars: openarray[char]) {.inline.} =
template appendMemCopy*(c: var WriteCursor, value: auto) = template appendMemCopy*(c: var WriteCursor, value: auto) =
bind append bind append
# TODO: add a check that this is a trivial type # TODO: add a check that this is a trivial type
c.append makeOpenArray(cast[ptr byte](unsafeAddr(value)), sizeof(value)) let valueAddr = unsafeAddr value
c.append makeOpenArray(cast[ptr byte](valueAddr), sizeof(value))
template append*(c: var WriteCursor, str: string) = template append*(c: var WriteCursor, str: string) =
bind append bind append