aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-01 17:25:10 -0400
committerRuss Cox <rsc@golang.org>2014-09-01 17:25:10 -0400
commitf611ae1c75b7696da141e55bf91a0acdcc853bf8 (patch)
tree2a5df4b9ae9e4096daccecc8c4de4278783ceab9 /src/pkg/runtime
parent3de7ba1873b3efb0004d61147cc049dd42d8725d (diff)
downloadgo-f611ae1c75b7696da141e55bf91a0acdcc853bf8.tar.xz
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
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/defs.c1
-rw-r--r--src/pkg/runtime/os_plan9.go2
-rw-r--r--src/pkg/runtime/os_plan9.h10
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;