mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: convert Iovec.Base to *byte in mkpost.go on solaris
Instead of defining a dedicated type goIovec with the correct *byte type for its Base field like CL 412496 did, modify the Base field of the original type Iovec (generated from struct iovec) in mkpost.go. This is akin to how we already change []int8 to []byte for several other types. Fixes golang/go#55997 Change-Id: If30799bb2bfe6d17678370b45348ff0b7c5de2e9 Reviewed-on: https://go-review.googlesource.com/c/sys/+/484635 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
3125361ba6
commit
1fb6828e5b
@@ -101,6 +101,17 @@ func main() {
|
||||
})
|
||||
}
|
||||
|
||||
if goos == "solaris" {
|
||||
// Convert *int8 to *byte in Iovec.Base like on every other platform.
|
||||
convertIovecBase := regexp.MustCompile(`Base\s+\*int8`)
|
||||
iovecType := regexp.MustCompile(`type Iovec struct {[^}]*}`)
|
||||
iovecStructs := iovecType.FindAll(b, -1)
|
||||
for _, s := range iovecStructs {
|
||||
newNames := convertIovecBase.ReplaceAll(s, []byte("Base *byte"))
|
||||
b = bytes.Replace(b, s, newNames, 1)
|
||||
}
|
||||
}
|
||||
|
||||
// Intentionally export __val fields in Fsid and Sigset_t
|
||||
valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`)
|
||||
b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}"))
|
||||
|
||||
Reference in New Issue
Block a user