New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall: mksyscall_windows.go doesn't handle goroot correctly #16493
Comments
CL https://golang.org/cl/25165 mentions this issue. |
What did you do? Did you run "go generate" command? Which directory? I don't understand what the problem is. Please provide more details. Thank you. Alex |
Few days ago, I contributed some patches for https://github.com/tompng/pokemon-go . In my configuration, |
I checked github.com/tompng/pokemon-go package. It does not use mksyscall_windows.go. Why are you telling me about github.com/tompng/pokemon-go package?
You keep repeating yourself. I understanding that you think there is a bug here. And I don't disagree with you. But I would like to see the bug by myself. Please provide some code or commands to demonstrate the bug. Show us some real computer output, and explain why that output is wrong in your opinion. Thank you. Alex |
Sorry much! I was confusing. True repository is my private for my job. Please check following code. foo.go is below: package foo
//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output bar.go foo.go
//sys GetLastError() (lasterr error)
and // MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT
package foo
import (
"internal/syscall/windows/sysdll"
"syscall"
"unsafe"
)
var _ unsafe.Pointer
var (
modkernel32 = syscall.NewLazyDLL(sysdll.Add("kernel32.dll"))
procGetLastError = modkernel32.NewProc("GetLastError")
)
func GetLastError() (lasterr error) {
r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0)
if r0 != 0 {
lasterr = syscall.Errno(r0)
}
return
}
P.S. I must say sorry again. |
Thanks for the test. Alex |
go version
)?go version devel +1d2ca9e Mon Jul 18 21:07:34 2016 +0000 windows/amd64
go env
)?windows/amd64
set GOROOT=c:\dev\go
set GOPATH=c:\dev\gopath
go generate with
//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall_windows.go
mksyscall_windows.go doesn't put import
internal/syscall/windows
because it's not a standard package, or x/sys package.I can see import
internal/syscall/windows
in the code.go/src/syscall/mksyscall_windows.go
Lines 698 to 712 in 4cffe44
goroot is checked without delimiter.
The text was updated successfully, but these errors were encountered: