From: Ian Lance Taylor Date: Wed, 6 May 2015 23:25:15 +0000 (-0700) Subject: cmd/cgo: add header guard for boilerplate in export header file X-Git-Tag: go1.5beta1~695 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2bb6f76a0530f14b34f4dae9ffa00859e72ecb23;p=gostls13.git cmd/cgo: add header guard for boilerplate in export header file Change-Id: If53563f3477222fe7409011b8780bb0926567251 Reviewed-on: https://go-review.googlesource.com/9767 Reviewed-by: Minux Ma --- diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index 22217a7b77..513b0ed001 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -1325,6 +1325,9 @@ func (p *Package) gccExportHeaderProlog() string { const gccExportHeaderProlog = ` /* Start of boilerplate cgo prologue. */ +#ifndef GO_CGO_PROLOGUE_H +#define GO_CGO_PROLOGUE_H + typedef signed char GoInt8; typedef unsigned char GoUint8; typedef short GoInt16; @@ -1351,6 +1354,8 @@ typedef void *GoChan; typedef struct { void *t; void *v; } GoInterface; typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; +#endif + /* End of boilerplate cgo prologue. */ `