Skip to content

Commit 63e90c3

Browse files
committed
runtime: generate defs_darwin_*.go again
As part of the conversion to Go, the defs_*.go files were converted directly instead of being regenerated with cgo -godefs. The result is they have diverged from the generated code, making the original scripts hard to use. This CL includes the generated defs_darwin_*.go files with no manual changes made to them. Includes minimal changes to other OS defs so that code shared with darwin can use the names directly generated by cgo. Manually tested darwin/{arm,arm64,386,amd64}. Change-Id: I48ee85842d67838e212224cf9882b54361392d75
1 parent db2e73f commit 63e90c3

34 files changed

+1106
-1096
lines changed

src/runtime/defs1_netbsd_386.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,17 @@ func (ts *timespec) set_nsec(x int32) {
120120
}
121121

122122
type timeval struct {
123-
tv_sec int64
124-
tv_usec int32
123+
Sec int64
124+
Usec int32
125125
}
126126

127-
func (tv *timeval) set_usec(x int32) {
128-
tv.tv_usec = x
127+
func (tv *timeval) setUsec(x int32) {
128+
tv.Usec = x
129129
}
130130

131131
type itimerval struct {
132-
it_interval timeval
133-
it_value timeval
132+
Interval timeval
133+
Value timeval
134134
}
135135

136136
type mcontextt struct {
@@ -149,12 +149,12 @@ type ucontextt struct {
149149
}
150150

151151
type keventt struct {
152-
ident uint32
153-
filter uint32
154-
flags uint32
155-
fflags uint32
156-
data int64
157-
udata *byte
152+
Ident uint32
153+
Filter uint32
154+
Flags uint32
155+
Fflags uint32
156+
Data int64
157+
Udata *byte
158158
}
159159

160160
// created by cgo -cdefs and then converted to Go

src/runtime/defs1_netbsd_amd64.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,18 @@ func (ts *timespec) set_nsec(x int32) {
123123
}
124124

125125
type timeval struct {
126-
tv_sec int64
127-
tv_usec int32
126+
Sec int64
127+
Usec int32
128128
pad_cgo_0 [4]byte
129129
}
130130

131-
func (tv *timeval) set_usec(x int32) {
132-
tv.tv_usec = x
131+
func (tv *timeval) setUsec(x int32) {
132+
tv.Usec = x
133133
}
134134

135135
type itimerval struct {
136-
it_interval timeval
137-
it_value timeval
136+
Interval timeval
137+
Value timeval
138138
}
139139

140140
type mcontextt struct {
@@ -153,13 +153,13 @@ type ucontextt struct {
153153
}
154154

155155
type keventt struct {
156-
ident uint64
157-
filter uint32
158-
flags uint32
159-
fflags uint32
156+
Ident uint64
157+
Filter uint32
158+
Flags uint32
159+
Fflags uint32
160160
pad_cgo_0 [4]byte
161-
data int64
162-
udata *byte
161+
Data int64
162+
Udata *byte
163163
}
164164

165165
// created by cgo -cdefs and then converted to Go

src/runtime/defs1_netbsd_arm.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ func (ts *timespec) set_nsec(x int32) {
121121
}
122122

123123
type timeval struct {
124-
tv_sec int64
125-
tv_usec int32
124+
Sec int64
125+
Usec int32
126126
}
127127

128-
func (tv *timeval) set_usec(x int32) {
129-
tv.tv_usec = x
128+
func (tv *timeval) setUsec(x int32) {
129+
tv.Usec = x
130130
}
131131

132132
type itimerval struct {
133-
it_interval timeval
134-
it_value timeval
133+
Interval timeval
134+
Value timeval
135135
}
136136

137137
type mcontextt struct {
@@ -151,12 +151,12 @@ type ucontextt struct {
151151
}
152152

153153
type keventt struct {
154-
ident uint32
155-
filter uint32
156-
flags uint32
157-
fflags uint32
158-
data int64
159-
udata *byte
154+
Ident uint32
155+
Filter uint32
156+
Flags uint32
157+
Fflags uint32
158+
Data int64
159+
Udata *byte
160160
}
161161

162162
// created by cgo -cdefs and then converted to Go

src/runtime/defs1_solaris_amd64.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ type timespec struct {
168168
}
169169

170170
type timeval struct {
171-
tv_sec int64
172-
tv_usec int64
171+
Sec int64
172+
Usec int64
173173
}
174174

175-
func (tv *timeval) set_usec(x int32) {
176-
tv.tv_usec = int64(x)
175+
func (tv *timeval) setUsec(x int32) {
176+
tv.Usec = int64(x)
177177
}
178178

179179
type itimerval struct {
180-
it_interval timeval
181-
it_value timeval
180+
Interval timeval
181+
Value timeval
182182
}
183183

184184
type portevent struct {

0 commit comments

Comments
 (0)