Skip to content

Commit b944f91

Browse files
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 29918e8 commit b944f91

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/cmd/cgo/out.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,9 +1652,7 @@ const builtinExportProlog = `
16521652
#ifndef GO_CGO_EXPORT_PROLOGUE_H
16531653
#define GO_CGO_EXPORT_PROLOGUE_H
16541654
1655-
typedef ptrdiff_t intgo;
1656-
1657-
typedef struct { const char *p; intgo n; } _GoString_;
1655+
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
16581656
16591657
#endif
16601658
`

0 commit comments

Comments
 (0)