Commit 3f66c0c0 authored by Shenghou Ma's avatar Shenghou Ma

cmd/cgo: document the cgo types also follow Go name space rules.

Fixes #7958.

LGTM=rsc
R=golang-codereviews, rsc, r, gobot
CC=golang-codereviews
https://golang.org/cl/91520043
parent 1afbceb5
...@@ -107,6 +107,11 @@ C's union types are represented as a Go byte array with the same length. ...@@ -107,6 +107,11 @@ C's union types are represented as a Go byte array with the same length.
Go structs cannot embed fields with C types. Go structs cannot embed fields with C types.
Cgo translates C types into equivalent unexported Go types.
Because the translations are unexported, a Go package should not
expose C types in its exported API: a C type used in one Go package
is different from the same C type used in another.
Any C function (even void functions) may be called in a multiple Any C function (even void functions) may be called in a multiple
assignment context to retrieve both the return value (if any) and the assignment context to retrieve both the return value (if any) and the
C errno variable as an error (use _ to skip the result value if the C errno variable as an error (use _ to skip the result value if the
......
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