Commit 10b189e7 authored by Jeet Parekh's avatar Jeet Parekh Committed by Austin Clements

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/126435Reviewed-by: 's avatarAustin Clements <austin@google.com>
parent c4d1ff19
......@@ -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)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment