]> Cypherpunks repositories - gostls13.git/commit
Add //export to cgo.
authorIan Lance Taylor <iant@golang.org>
Fri, 9 Apr 2010 20:31:05 +0000 (13:31 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 9 Apr 2010 20:31:05 +0000 (13:31 -0700)
commit12e7ce95c697b85bd78a652dd6f4a7a0e81cf72a
tree268b32306e53cd6815f19b1b4f0c4f1365041202
parent2e20386fc7a0bc4bf5f3950ae6b5be897f005086
Add //export to cgo.

The new //export comment marks a Go function as callable from
C.  The syntax is "//export NAME" where NAME is the name of
the function as seen from C.  If such a comment is seen, cgo
will generate two new files: _cgo_export.h and _cgo_export.c.
The _cgo_export.h file provides declarations which C code may
use to call Go functions.  The _cgo_export.c file contains
wrappers, and is to be compiled with gcc.

The changes to Make.pkg support using this from a Go Makefile,
though it could probably be more convenient.

R=rsc
CC=golang-dev
https://golang.org/cl/853042
src/Make.pkg
src/cmd/cgo/ast.go
src/cmd/cgo/out.go