1
0
mirror of https://github.com/golang/go synced 2024-11-19 12:14:42 -07:00

syscall: fix handling of bool return values in mksyscall_windows.go

LGTM=chines
R=chines
CC=golang-codereviews
https://golang.org/cl/118160044
This commit is contained in:
Alex Brainman 2014-07-25 15:13:59 +10:00
parent 43ad89d627
commit 5e805aff4a

View File

@ -283,9 +283,12 @@ func (r *Rets) SetErrorCode() string {
return fmt.Sprintf(code, r.Name, syscalldot())
}
s := ""
if r.Type[0] == '*' {
switch {
case r.Type[0] == '*':
s = fmt.Sprintf("%s = (%s)(unsafe.Pointer(r0))", r.Name, r.Type)
} else {
case r.Type == "bool":
s = fmt.Sprintf("%s = r0 != 0", r.Name)
default:
s = fmt.Sprintf("%s = %s(r0)", r.Name, r.Type)
}
if !r.ReturnsError {