mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-06 09:07:16 -04:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user