ソースを参照

unix: correctly rename Val member in Sigset_t on freebsd

The generated name X__bits should be changed to Val to match the type on
Linux. This was done manually in CL 179099 when Sigset_t was added for
freebsd. Modify mkpost.go to do it, so future changes won't revert the
rename.

Change-Id: I0ce135cbd8d03648a1576244d9c977b39c8f5889
Reviewed-on: https://go-review.googlesource.com/c/sys/+/183220
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Tobias Klauser 6 年 前
コミット
06bbe82148
1 ファイル変更2 行追加2 行削除
  1. 2 2
      unix/mkpost.go

+ 2 - 2
unix/mkpost.go

@@ -50,8 +50,8 @@ func main() {
 	}
 
 	// Intentionally export __val fields in Fsid and Sigset_t
-	valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`)
-	b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}"))
+	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}"))
 
 	// Intentionally export __fds_bits field in FdSet
 	fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`)