diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-06-03 11:31:24 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-06-03 11:38:02 +0200 |
commit | 13f4fcd5bf09c70942b6c85a2b919ffa1ca0c6a8 (patch) | |
tree | 717e1ceeef3a60af29e7897c7629d1502b797838 /src/cmd/cgo/doc.go | |
parent | 6bf52070ef1028f7fcc98fad1e73795a7efd7ce7 (diff) | |
download | golang-13f4fcd5bf09c70942b6c85a2b919ffa1ca0c6a8.tar.gz |
Imported Upstream version 2011.06.02
Diffstat (limited to 'src/cmd/cgo/doc.go')
-rw-r--r-- | src/cmd/cgo/doc.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index b3aa9aded..064725c1d 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -35,9 +35,17 @@ systems. For example: // #include <png.h> import "C" -C identifiers or field names that are keywords in Go can be -accessed by prefixing them with an underscore: if x points at -a C struct with a field named "type", x._type accesses the field. +Alternatively, CFLAGS and LDFLAGS may be obtained via the pkg-config +tool using a '#cgo pkg-config:' directive followed by the package names. +For example: + + // #cgo pkg-config: png cairo + // #include <png.h> + import "C" + +Within the Go file, C identifiers or field names that are keywords in Go +can be accessed by prefixing them with an underscore: if x points at a C +struct with a field named "type", x._type accesses the field. The standard C numeric types are available under the names C.char, C.schar (signed char), C.uchar (unsigned char), |