Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
levovix0 committed Dec 16, 2020
1 parent 7167035 commit beb425e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/siwin/libwinapi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ when defined(windows):

type WinapiError* = object of OSError

template winassert*(a: bool) =
template winassertImpl*(a: untyped, s: string) =
try: doassert a
except AssertionDefect:
let s = astToStr(a)
raise WinapiError.newException "assertion failed: `" & s & "`"
template winassert*(a: bool) =
winassertImpl(a, astToStr(a))

var hInstance* = GetModuleHandle(nil)

Expand Down
6 changes: 2 additions & 4 deletions src/siwin/libx11.nim
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ when defined(linux):
let r = a.bool
if r == false: raise X11Error.newException("error after " & s)
template xcheckStatus*(a: Status) =
let s = astToStr(a)
xcheckStatusImpl(a, s)
xcheckStatusImpl(a, astToStr(a))
template xcheck*(a: cint) =
let s = astToStr(a)
xcheckImpl(a, s)
xcheckImpl(a, astToStr(a))

type AtomKind* {.pure.} = enum
WM_DELETE_WINDOW
Expand Down

0 comments on commit beb425e

Please sign in to comment.