1
0
mirror of https://github.com/golang/go synced 2024-11-20 00:34:43 -07:00

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
This commit is contained in:
Russ Cox 2014-09-01 17:25:10 -04:00
parent 3de7ba1873
commit f611ae1c75
3 changed files with 8 additions and 5 deletions

View File

@ -13,3 +13,4 @@
#include "chan.h" #include "chan.h"
#include "mprof.h" #include "mprof.h"
#include "defs_GOOS_GOARCH.h" #include "defs_GOOS_GOARCH.h"
#include "os_GOOS.h"

View File

@ -26,3 +26,5 @@ func errstr() string
// The size of the note handler frame varies among architectures, // The size of the note handler frame varies among architectures,
// but 512 bytes should be enough for every implementation. // but 512 bytes should be enough for every implementation.
const stackSystem = 512 const stackSystem = 512
type _Plink uintptr

View File

@ -59,15 +59,15 @@ enum
}; };
typedef struct Tos Tos; typedef struct Tos Tos;
typedef intptr Plink; typedef intptr _Plink;
struct Tos { struct Tos {
struct /* Per process profiling */ struct /* Per process profiling */
{ {
Plink *pp; /* known to be 0(ptr) */ _Plink *pp; /* known to be 0(ptr) */
Plink *next; /* known to be 4(ptr) */ _Plink *next; /* known to be 4(ptr) */
Plink *last; _Plink *last;
Plink *first; _Plink *first;
uint32 pid; uint32 pid;
uint32 what; uint32 what;
} prof; } prof;