aboutsummaryrefslogtreecommitdiff
path: root/src/pkg
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2014-08-05 18:12:32 -0700
committerIan Lance Taylor <iant@golang.org>2014-08-05 18:12:32 -0700
commitf7a8adbd511e921111fc0682d380a6f7a33e0c93 (patch)
treead4c08167f3e0c6b142f9b1540bc794d7d415f09 /src/pkg
parent48e75337839d21079c9763d3447ade409ee2c32a (diff)
downloadgo-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')
-rw-r--r--src/pkg/runtime/defs_linux.go1
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"