diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-11 12:10:37 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-11 12:10:37 -0400 |
| commit | 294cb8d166d5e5d0f5a18ce6c785ddc2692a939a (patch) | |
| tree | 53a7c43e21b3203b5e34aef2b6d5a1357b31a24e | |
| parent | 0260b7c867f72e4e1e5287960e9b4ebd3f607826 (diff) | |
More refinement of struct output in zwinconstgen.go.
| -rw-r--r-- | redo/zwinconstgen.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/redo/zwinconstgen.go b/redo/zwinconstgen.go index 3a9053e..a6faf0a 100644 --- a/redo/zwinconstgen.go +++ b/redo/zwinconstgen.go @@ -127,7 +127,15 @@ func winName(t reflect.Type) string { case reflect.Struct: // the t.Name() will be the cgo-mangled name; get the original name out parts := strings.Split(t.Name(), "_") - return "s_" + parts[len(parts) - 1] + part := parts[len(parts) - 1] + // many Windows API types have struct tagXXX as their declarator + // if you wonder why, see http://blogs.msdn.com/b/oldnewthing/archive/2008/03/26/8336829.aspx?Redirected=true + if strings.HasPrefix(part, "tag") { + part = part[3:] + } + return "s_" + part + case reflect.Array: + return fmt.Sprintf("[%d]%s", t.Len(), winName(t.Elem())) } return t.Kind().String() } |
