Message:
Hello [email protected], [email protected] (cc:
[email protected], [email protected]),
I'd like you to review this change to
https://code.google.com/p/go/
Description:
exp/ssa/interp: fix build for Plan 9
Please review this at https://codereview.appspot.com/7300078/
Affected files:
M src/pkg/exp/ssa/interp/external_plan9.go
M src/pkg/exp/ssa/interp/external_unix.go
M src/pkg/exp/ssa/interp/external_windows.go
Index: src/pkg/exp/ssa/interp/external_plan9.go
===================================================================
copy from src/pkg/exp/ssa/interp/external_unix.go
copy to src/pkg/exp/ssa/interp/external_plan9.go
--- a/src/pkg/exp/ssa/interp/external_unix.go
+++ b/src/pkg/exp/ssa/interp/external_plan9.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !windows,!plan9
-
package interp
import (
@@ -12,10 +10,7 @@
)
func ext۰syscall۰Kill(fn *ssa.Function, args []value, slots []value) value
{
- // We could emulate syscall.Syscall but it's more effort.
- err := syscall.Kill(args[0].(int), syscall.Signal(args[1].(int)))
- err = err // TODO(adonovan): fix: adapt concrete err to interpreted iface
(e.g. call interpreted errors.New)
- return iface{}
+ panic("syscall.Kill not yet implemented")
}
func ext۰syscall۰Write(fn *ssa.Function, args []value, slots []value)
value {
@@ -28,5 +23,4 @@
n, _ := syscall.Write(args[0].(int), b)
err := iface{} // TODO(adonovan): fix: adapt concrete err to interpreted
iface.
return tuple{n, err}
-
}
Index: src/pkg/exp/ssa/interp/external_unix.go
===================================================================
--- a/src/pkg/exp/ssa/interp/external_unix.go
+++ b/src/pkg/exp/ssa/interp/external_unix.go
@@ -28,5 +28,4 @@
n, _ := syscall.Write(args[0].(int), b)
err := iface{} // TODO(adonovan): fix: adapt concrete err to interpreted
iface.
return tuple{n, err}
-
}
Index: src/pkg/exp/ssa/interp/external_windows.go
===================================================================
--- a/src/pkg/exp/ssa/interp/external_windows.go
+++ b/src/pkg/exp/ssa/interp/external_windows.go
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build windows plan9
+// +build windows
package interp
import (
"exp/ssa"
+ "syscall"
)
func ext۰syscall۰Kill(fn *ssa.Function, args []value, slots []value) value
{
@@ -15,5 +16,13 @@
}
func ext۰syscall۰Write(fn *ssa.Function, args []value, slots []value)
value {
- panic("syscall.Write not yet implemented")
+ // We could emulate syscall.Syscall but it's more effort.
+ p := args[1].([]value)
+ b := make([]byte, 0, len(p))
+ for i := range p {
+ b = append(b, p[i].(byte))
+ }
+ n, _ := syscall.Write(args[0].(syscall.Handle), b)
+ err := iface{} // TODO(adonovan): fix: adapt concrete err to interpreted
iface.
+ return tuple{n, err}
}
--
---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.