avoid platform specific C int types in go code

This commit is contained in:
Ted Unangst 2020-07-04 15:43:09 -04:00
parent 8413627ec1
commit d8b196cbc1
1 changed files with 6 additions and 1 deletions

View File

@ -17,6 +17,11 @@ package main
/*
#include <termios.h>
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()