windows/mkwinsyscall: sort by dll names and dll function names

Otherwise generated file changes every time //sys lines are moved
around, or when mkwinsyscall command parameters are reordered.

Change-Id: Ie4bdbee2ba50f9cea36ec78ce9951c57bd5da8a7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/260900
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Alex Brainman
2020-10-13 08:18:32 +00:00
parent 56aa3af1a1
commit 0aaa271806
3 changed files with 2785 additions and 2781 deletions
+8
View File
@@ -663,6 +663,7 @@ func (src *Source) DLLs() []string {
r = append(r, name)
}
}
sort.Strings(r)
return r
}
@@ -697,6 +698,13 @@ func (src *Source) ParseFile(path string) error {
return err
}
src.Files = append(src.Files, path)
sort.Slice(src.Funcs, func(i, j int) bool {
fi, fj := src.Funcs[i], src.Funcs[j]
if fi.DLLName() == fj.DLLName() {
return fi.DLLFuncName() < fj.DLLFuncName()
}
return fi.DLLName() < fj.DLLName()
})
// get package name
fset := token.NewFileSet()