avoid platform specific C int types in go code
This commit is contained in:
parent
8413627ec1
commit
d8b196cbc1
7
admin.go
7
admin.go
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue