summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redo/zwinconstgen.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/redo/zwinconstgen.go b/redo/zwinconstgen.go
index 2a44589..f2db8b1 100644
--- a/redo/zwinconstgen.go
+++ b/redo/zwinconstgen.go
@@ -92,6 +92,7 @@ import (
"bytes"
"reflect"
"go/format"
+ "strings"
)
// #define UNICODE
// #define _UNICODE
@@ -108,7 +109,16 @@ import (
// #include <stdint.h>
{{range .Consts}}// uintptr_t {{.}} = (uintptr_t) ({{noprefix .}});
{{end}}import "C"
+// MinGW will generate handle pointers as pointers to some structure type under some conditions I don't fully understand; here's full overrides
+var handleOverrides = []string{
+ "HWND",
+}
func winName(t reflect.Type) string {
+ for _, s := range handleOverrides {
+ if strings.Contains(t.Name(), s) {
+ return "uintptr"
+ }
+ }
switch t.Kind() {
case reflect.UnsafePointer:
return "uintptr"