From 10b189e7aa37dd026e4c1c16d84c6515a393f8ed Mon Sep 17 00:00:00 2001 From: Jeet Parekh Date: Fri, 27 Jul 2018 18:46:14 +0000 Subject: [PATCH] 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 --- windows/syscall_windows.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/windows/syscall_windows.go b/windows/syscall_windows.go index 1e9f4bb4..fd89e08e 100644 --- a/windows/syscall_windows.go +++ b/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) }