Merge branch 'master' of https://github.com/h3rald/nimline
h3rald h3rald@h3rald.com
Sat, 28 Oct 2017 17:42:47 +0200
1 files changed,
8 insertions(+),
4 deletions(-)
jump to
M
nimline.nim
→
nimline.nim
@@ -8,11 +8,15 @@ os
system.addQuitProc(resetAttributes) -proc putchr*(c: cint) = - stdout.write(c.chr) +when defined(windows): + proc getchr*(): cint {.header: "<conio.h>", importc: "_getch".} + proc putchr*(c: cint): cint {.discardable, header: "<conio.h>", importc: "_putch".} +else: + proc putchr*(c: cint) = + stdout.write(c.chr) -proc getchr*(): cint = - return getch().ord + proc getchr*(): cint = + return getch().ord # Types