summaryrefslogtreecommitdiff
path: root/src/cmd/cgo/doc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/cgo/doc.go')
-rw-r--r--src/cmd/cgo/doc.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go
index 0f9204d7f..c4868345c 100644
--- a/src/cmd/cgo/doc.go
+++ b/src/cmd/cgo/doc.go
@@ -23,6 +23,15 @@ the package. For example:
// #include <errno.h>
import "C"
+CFLAGS and LDFLAGS may be defined with pseudo #cgo directives
+within these comments to tweak the behavior of gcc. Values defined
+in multiple directives are concatenated together. For example:
+
+ // #cgo CFLAGS: -DPNG_DEBUG=1
+ // #cgo LDFLAGS: -lpng
+ // #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.