summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-09-23 16:29:53 -0400
committerRuss Cox <rsc@golang.org>2013-09-23 16:29:53 -0400
commita4f9e9a489a32fc266c1358626617752fe965b13 (patch)
treeba9f778af420d0df2b7ca8155c2706659b7d32fb
parente107738a9d3e271f44dbdf9d80ba144761f8f89d (diff)
downloadgo-a4f9e9a489a32fc266c1358626617752fe965b13.tar.gz
cmd/cgo: update #cgo docs to reflect reality
The syntax accepted is full build constraints, not just GOOS, GOARCH, and GOOS/GOARCH. R=golang-dev, iant CC=golang-dev https://codereview.appspot.com/13504048
-rw-r--r--src/cmd/cgo/doc.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go
index 8ee6ddf95..275872632 100644
--- a/src/cmd/cgo/doc.go
+++ b/src/cmd/cgo/doc.go
@@ -27,11 +27,13 @@ http://golang.org/doc/articles/c_go_cgo.html.
CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS may be defined with pseudo #cgo
directives within these comments to tweak the behavior of the C or C++
compiler. Values defined in multiple directives are concatenated
-together. Options prefixed by $GOOS, $GOARCH, or $GOOS/$GOARCH are
-only defined in matching systems. For example:
+together. The directive can include a list of build constraints limiting its
+effect to systems satisfying one of the constraints
+(see http://golang.org/pkg/go/build/#hdr-Build_Constraints for details about the constraint syntax).
+For example:
// #cgo CFLAGS: -DPNG_DEBUG=1
- // #cgo linux CFLAGS: -DLINUX=1
+ // #cgo amd64 386 CFLAGS: -DX86=1
// #cgo LDFLAGS: -lpng
// #include <png.h>
import "C"