diff options
author | Gustavo Niemeyer <gustavo@niemeyer.net> | 2011-02-03 13:51:47 -0500 |
---|---|---|
committer | Gustavo Niemeyer <gustavo@niemeyer.net> | 2011-02-03 13:51:47 -0500 |
commit | 2d5fe0b4bb5a8ec588287bb29fee592ba32102fd (patch) | |
tree | 6dfecc7f0f2bc55661d89061f90ef0f92e6c959d /src/cmd/cgo/doc.go | |
parent | b844793155965a73646513b5bdef0276e4f25877 (diff) | |
download | go-2d5fe0b4bb5a8ec588287bb29fee592ba32102fd.tar.gz |
cgo: os/arch dependent #cgo directives
This enables #cgo directives to contain a os/arch
specification which restricts the definition of
the given option to matching systems.
For example:
#cgo amd64 CFLAGS: -DAMD64=1
#cgo linux CFLAGS: -DLINUX=1
#cgo linux/amd64 CFLAGS: -DLINUX_ON_AMD64=1
R=rsc
CC=golang-dev
http://codereview.appspot.com/4121048
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd/cgo/doc.go')
-rw-r--r-- | src/cmd/cgo/doc.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index c4868345c..b3aa9aded 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -25,9 +25,12 @@ the package. For example: 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: +in multiple directives are concatenated together. Options prefixed +by $GOOS, $GOARCH, or $GOOS/$GOARCH are only defined in matching +systems. For example: // #cgo CFLAGS: -DPNG_DEBUG=1 + // #cgo linux CFLAGS: -DLINUX=1 // #cgo LDFLAGS: -lpng // #include <png.h> import "C" |