diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-10 09:46:00 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-10 09:46:00 -0400 |
| commit | 7b2e6b7fa3799ce686dd7509cf9cf6d9b94c2835 (patch) | |
| tree | 44482c1eab182b383b75c40faee26102bf2de5c3 /tools/windowsconstgen.go | |
| parent | e432e6fecff4554ceccb0e9dbc7a8b915fc90d2b (diff) | |
Made adjustments to the output of windowsconstgen to please go fmt.
Diffstat (limited to 'tools/windowsconstgen.go')
| -rw-r--r-- | tools/windowsconstgen.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/windowsconstgen.go b/tools/windowsconstgen.go index 777324d..37cdd22 100644 --- a/tools/windowsconstgen.go +++ b/tools/windowsconstgen.go @@ -104,7 +104,7 @@ func hacknamesPreamble() string { func preamble(pkg string) string { return "// autogenerated by windowsconstgen; do not edit\n" + - "package " + pkg + "\n" + "package " + pkg + "\n\n" // two newlines to please go fmt } // for backwards compatibiilty reasons, Windows defines GetWindowLongPtr()/SetWindowLongPtr() as a macro which expands to GetWindowLong()/SetWindowLong() on 32-bit systems @@ -118,6 +118,10 @@ func printConst(f *os.File, goconst string, winconst string) { fmt.Fprintf(f, " fmt.Println(\"const %s =\", C.%s)\n", goconst, winconst) } +func printBlankLine(f *os.File) { + fmt.Fprintf(f, " fmt.Println()\n") +} + func printGWLPName(f *os.File, which string, char string, targetarch string) { fmt.Fprintf(f, " fmt.Println(\"var %s = user32.NewProc(\\\"%s\\\")\")\n", which, char + gwlpNames[targetarch]) @@ -188,6 +192,7 @@ func main() { // not a hack name; strip the leading _ from the value name but keep the constant name unchanged printConst(f, ident, ident[1:]) } + printBlankLine(f) // to please go fmt // and now for _getWindowLongPtr/_setWindowLongPtr printGWLPName(f, "_getWindowLongPtr", "G", targetarch) printGWLPName(f, "_setWindowLongPtr", "S", targetarch) |
