]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: add header guard for boilerplate in export header file
authorIan Lance Taylor <iant@golang.org>
Wed, 6 May 2015 23:25:15 +0000 (16:25 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 7 May 2015 00:05:08 +0000 (00:05 +0000)
Change-Id: If53563f3477222fe7409011b8780bb0926567251
Reviewed-on: https://go-review.googlesource.com/9767
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/cgo/out.go

index 22217a7b77c802ae8c18f87c94adc7e0e9ec9b00..513b0ed001ff230f8cbabe3e0749e1d29ef3818f 100644 (file)
@@ -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.  */
 `