From f611ae1c75b7696da141e55bf91a0acdcc853bf8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 1 Sep 2014 17:25:10 -0400 Subject: [PATCH] runtime: include os_*.h in the generated Go structs Adding the #include to defs.c makes it get processed by cmd/dist, which writes out Go equivalent for all the C data structures defined in defs.c. This in turn makes it necessary to define the Plink type, used in os_plan9.h, in os_plan9.go. Rename it to _Plink to avoid being exported. LGTM=0intro, iant R=golang-codereviews, iant, 0intro CC=golang-codereviews, r https://golang.org/cl/132490043 --- src/pkg/runtime/defs.c | 1 + src/pkg/runtime/os_plan9.go | 2 ++ src/pkg/runtime/os_plan9.h | 10 +++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pkg/runtime/defs.c b/src/pkg/runtime/defs.c index b6ed9c8115..956bf69867 100644 --- a/src/pkg/runtime/defs.c +++ b/src/pkg/runtime/defs.c @@ -13,3 +13,4 @@ #include "chan.h" #include "mprof.h" #include "defs_GOOS_GOARCH.h" +#include "os_GOOS.h" diff --git a/src/pkg/runtime/os_plan9.go b/src/pkg/runtime/os_plan9.go index 7b215c754c..4a7b16fd64 100644 --- a/src/pkg/runtime/os_plan9.go +++ b/src/pkg/runtime/os_plan9.go @@ -26,3 +26,5 @@ func errstr() string // The size of the note handler frame varies among architectures, // but 512 bytes should be enough for every implementation. const stackSystem = 512 + +type _Plink uintptr diff --git a/src/pkg/runtime/os_plan9.h b/src/pkg/runtime/os_plan9.h index 8bc57262d9..ea853dde85 100644 --- a/src/pkg/runtime/os_plan9.h +++ b/src/pkg/runtime/os_plan9.h @@ -59,15 +59,15 @@ enum }; typedef struct Tos Tos; -typedef intptr Plink; +typedef intptr _Plink; struct Tos { struct /* Per process profiling */ { - Plink *pp; /* known to be 0(ptr) */ - Plink *next; /* known to be 4(ptr) */ - Plink *last; - Plink *first; + _Plink *pp; /* known to be 0(ptr) */ + _Plink *next; /* known to be 4(ptr) */ + _Plink *last; + _Plink *first; uint32 pid; uint32 what; } prof;