From: Joel Sing Date: Mon, 4 Jun 2012 15:38:55 +0000 (+1000) Subject: misc/cgo/stdio: split stdout/stderr into a separate file X-Git-Tag: go1.1rc2~3004 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b945b741e15b09f98ae6298d9698bd50a806267a;p=gostls13.git misc/cgo/stdio: split stdout/stderr into a separate file Split stdout/stderr into a separate file so that can be handled differently on some platforms. Both NetBSD and OpenBSD have defines for stdout/stderr that require some coercion in order for cgo to handle them correctly. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6247062 --- diff --git a/misc/cgo/stdio/file.go b/misc/cgo/stdio/file.go index 6e7d479ad9..a202f358c6 100644 --- a/misc/cgo/stdio/file.go +++ b/misc/cgo/stdio/file.go @@ -23,9 +23,6 @@ import "unsafe" type File C.FILE -var Stdout = (*File)(C.stdout) -var Stderr = (*File)(C.stderr) - // Test reference to library symbol. // Stdout and stderr are too special to be a reliable test. //var = C.environ diff --git a/misc/cgo/stdio/stdio.go b/misc/cgo/stdio/stdio.go new file mode 100644 index 0000000000..67b7aea1e2 --- /dev/null +++ b/misc/cgo/stdio/stdio.go @@ -0,0 +1,15 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !netbsd + +package stdio + +/* +#include +*/ +import "C" + +var Stdout = (*File)(C.stdout) +var Stderr = (*File)(C.stderr)