mirror of
https://github.com/golang/go
synced 2024-11-25 03:57:56 -07:00
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
This commit is contained in:
parent
677cdb800d
commit
b945b741e1
@ -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
|
||||
|
15
misc/cgo/stdio/stdio.go
Normal file
15
misc/cgo/stdio/stdio.go
Normal file
@ -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 <stdio.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
var Stdout = (*File)(C.stdout)
|
||||
var Stderr = (*File)(C.stderr)
|
Loading…
Reference in New Issue
Block a user