]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: include os_*.h in the generated Go structs
authorRuss Cox <rsc@golang.org>
Mon, 1 Sep 2014 21:25:10 +0000 (17:25 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 1 Sep 2014 21:25:10 +0000 (17:25 -0400)
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
src/pkg/runtime/os_plan9.go
src/pkg/runtime/os_plan9.h

index b6ed9c8115b3cb8bddc957f89a7e2c43a871d216..956bf698673a783b618347ac6d14292d032ec59a 100644 (file)
@@ -13,3 +13,4 @@
 #include "chan.h"
 #include "mprof.h"
 #include "defs_GOOS_GOARCH.h"
+#include "os_GOOS.h"
index 7b215c754c3c616dca8f5cc7be3f82a2a25077c6..4a7b16fd64311c2a1f95e28e8f43b6d9fd4b5da8 100644 (file)
@@ -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
index 8bc57262d951a2c0eb3604a2ceaa5133d9b4a6d4..ea853dde8511441839d193c4243f110ce42da059 100644 (file)
@@ -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;