From d8b196cbc154e964c09f79463a9280b40144757a Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 4 Jul 2020 15:43:09 -0400 Subject: [PATCH] avoid platform specific C int types in go code --- admin.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/admin.go b/admin.go index 17f5598..5ca8677 100644 --- a/admin.go +++ b/admin.go @@ -17,6 +17,11 @@ package main /* #include +void +clearecho(struct termios *tio) +{ + tio->c_lflag = tio->c_lflag & ~(ECHO|ICANON); +} */ import "C" import ( @@ -117,7 +122,7 @@ func adminscreen() { init := func() { tio := new(C.struct_termios) C.tcgetattr(1, tio) - tio.c_lflag = tio.c_lflag & ^C.uint(C.ECHO|C.ICANON) + C.clearecho(tio) C.tcsetattr(1, C.TCSADRAIN, tio) hidecursor()