From b944f91f1500b487b9d219e1b83e106cb330eb3c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 13 Dec 2017 17:29:28 -0800 Subject: [PATCH] cmd/cgo: don't define intgo in export prologue The export prologue goes into the _cgo_export.h file, where it may be be #include'd by a .swig file. As SWIG defines its own type "intgo", the definition of "intgo" in the export prologue could conflict. Since we don't need to define "intgo" in the _cgo_export.h file, don't. Defining "intgo" in _cgo_export.h was new for this release, so this should not break any existing code. No test case as I can't quite bring myself to write a test that combines SWIG and cgo. Change-Id: I8073e8300a1860cecd5994b9ad07dd35a4298c89 Reviewed-on: https://go-review.googlesource.com/83936 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/cgo/out.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index 8834c3db5a..44a00d8154 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -1652,9 +1652,7 @@ const builtinExportProlog = ` #ifndef GO_CGO_EXPORT_PROLOGUE_H #define GO_CGO_EXPORT_PROLOGUE_H -typedef ptrdiff_t intgo; - -typedef struct { const char *p; intgo n; } _GoString_; +typedef struct { const char *p; ptrdiff_t n; } _GoString_; #endif ` -- 2.50.0