fzf: fix musl build

This commit is contained in:
Dominik Honnef 2015-06-06 23:34:34 +02:00
parent 695e23bee8
commit 3a860badec
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 5073ddcd87868dfbaab7a8b2f2eff4cb509662a9 Mon Sep 17 00:00:00 2001
From: Dominik Honnef <dominik@honnef.co>
Date: Sat, 6 Jun 2015 23:25:03 +0200
Subject: [PATCH] Portable implementation of swapOutput
Assigning to stdin, stdout and stderr is not portable. They're specified
to be macros, and for example musl will not allow such code to be
compiled.
Use dup2 instead.
---
src/curses/curses.go | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/curses/curses.go b/src/curses/curses.go
index 985dd87..1cfc2c9 100644
--- src/curses/curses.go
+++ src/curses/curses.go
@@ -1,13 +1,14 @@
package curses
/*
+#include <unistd.h>
#include <ncurses.h>
#include <locale.h>
#cgo LDFLAGS: -lncurses
void swapOutput() {
- FILE* temp = stdout;
- stdout = stderr;
- stderr = temp;
+ dup2(2, 3);
+ dup2(1, 2);
+ dup2(3, 1);
}
*/
import "C"
--
2.3.6

View File

@ -1,7 +1,7 @@
# Template file for 'fzf'
pkgname=fzf
version=0.9.13
revision=1
revision=2
_version=${version}
wrksrc=${pkgname}-${_version}
build_style=go