m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-14 14:23:47 -05:00

Fix i386 build

This commit is contained in:
Junegunn Choi
2015-01-07 00:24:05 +09:00
parent 6109a0fe44
commit b277f5ae6f
5 changed files with 29 additions and 22 deletions

View File

@@ -1,8 +1,15 @@
package curses
// #include <ncurses.h>
// #include <locale.h>
// #cgo LDFLAGS: -lncurses
/*
#include <ncurses.h>
#include <locale.h>
#cgo LDFLAGS: -lncurses
void swapOutput() {
FILE* temp = stdout;
stdout = stderr;
stderr = temp;
}
*/
import "C"
import (
@@ -162,7 +169,7 @@ func Init(color bool, color256 bool, black bool, mouse bool) {
// syscall.Dup2(int(in.Fd()), int(os.Stdin.Fd()))
}
swapOutput()
C.swapOutput()
C.setlocale(C.LC_ALL, C.CString(""))
C.initscr()
@@ -218,13 +225,7 @@ func Init(color bool, color256 bool, black bool, mouse bool) {
func Close() {
C.endwin()
swapOutput()
}
func swapOutput() {
syscall.Dup2(2, 3)
syscall.Dup2(1, 2)
syscall.Dup2(3, 1)
C.swapOutput()
}
func GetBytes() []byte {