diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2014-08-05 18:12:32 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2014-08-05 18:12:32 -0700 |
| commit | f7a8adbd511e921111fc0682d380a6f7a33e0c93 (patch) | |
| tree | ad4c08167f3e0c6b142f9b1540bc794d7d415f09 /src/pkg/runtime | |
| parent | 48e75337839d21079c9763d3447ade409ee2c32a (diff) | |
| download | go-f7a8adbd511e921111fc0682d380a6f7a33e0c93.tar.xz | |
cmd/cgo: fix handling of defs_linux.go
Instead of including <sys/types.h> to get size_t, instead include
the ISO C standard <stddef.h> header, which defines fewer additional
types at risk of colliding with the user code. In particular, this
prevents collisions between <sys/types.h>'s userspace definitions with
the kernel definitions needed by defs_linux.go.
Also, -cdefs mode uses #pragma pack, so we can keep misaligned fields.
Fixes #8477.
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/120610043
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/defs_linux.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/runtime/defs_linux.go b/src/pkg/runtime/defs_linux.go index 2f4e03a016..8657dbb0ec 100644 --- a/src/pkg/runtime/defs_linux.go +++ b/src/pkg/runtime/defs_linux.go @@ -28,6 +28,7 @@ package runtime #include <asm-generic/errno.h> #include <asm-generic/poll.h> #include <linux/eventpoll.h> +#undef size_t */ import "C" |
