cgo: make file path work for windows

R=golang-dev, mattn.jp, adg
CC=golang-dev
https://golang.org/cl/4634043
This commit is contained in:
Alex Brainman 2011-06-17 10:17:33 +10:00 committed by Andrew Gerrand
parent 380e5a3709
commit c562fbc44e
4 changed files with 14 additions and 10 deletions

View file

@ -18,6 +18,7 @@ import (
"go/token"
"io"
"os"
"path/filepath"
"reflect"
"strings"
)
@ -228,7 +229,7 @@ func main() {
}
pkg := f.Package
if dir := os.Getenv("CGOPKGPATH"); dir != "" {
pkg = dir + "/" + pkg
pkg = filepath.Join(dir, pkg)
}
p.PackagePath = pkg
p.writeOutput(f, input)