Explorar o código

x/sys: improve NewCallback documentation

Keeps the documentation in sync with syscall package. Copies the changes from CL https://golang.org/cl/126035.

Change-Id: I778725fd7d5e96ddf839d33e1d220e5a12e2d24f
GitHub-Last-Rev: 4b30513126d7ffbca31640a6120a2259b6a226db
GitHub-Pull-Request: golang/sys#12
Reviewed-on: https://go-review.googlesource.com/126435
Reviewed-by: Austin Clements <austin@google.com>
Jeet Parekh %!s(int64=7) %!d(string=hai) anos
pai
achega
10b189e7aa
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      windows/syscall_windows.go

+ 2 - 0
windows/syscall_windows.go

@@ -112,12 +112,14 @@ func Getpagesize() int { return 4096 }
 
 // NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention.
 // This is useful when interoperating with Windows code requiring callbacks.
+// The argument is expected to be a function with with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr.
 func NewCallback(fn interface{}) uintptr {
 	return syscall.NewCallback(fn)
 }
 
 // NewCallbackCDecl converts a Go function to a function pointer conforming to the cdecl calling convention.
 // This is useful when interoperating with Windows code requiring callbacks.
+// The argument is expected to be a function with with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr.
 func NewCallbackCDecl(fn interface{}) uintptr {
 	return syscall.NewCallbackCDecl(fn)
 }