go-win32api
go-win32api copied to clipboard
HEAD fails to compile, but HEAD^ compiles fine
Using go 1.25.0, checking out HEAD^
git clone https://github.com/zzl/go-win32api --revision HEAD^ go-win32api@HEAD~1
works fine:
Cloning into 'go-win32api@HEAD~1'...
...
$ cd go-win32api@HEAD~1
$ go build -v ./...
github.com/zzl/go-win32api/v2/win32
github.com/zzl/go-win32api/v2/examples/console_io
github.com/zzl/go-win32api/v2/examples/propertystore/win32x
github.com/zzl/go-win32api/v2/examples/window_helloworld
github.com/zzl/go-win32api/v2/examples/propertystore
$
But running
git clone https://github.com/zzl/go-win32api go-win32api@HEAD
does not work:
Cloning into 'go-win32api@HEAD'...
...
$ cd go-win32api@HEAD
$ go build -v ./...
github.com/zzl/go-win32api/v2/win32
github.com/zzl/go-win32api/v2/examples/console_io
github.com/zzl/go-win32api/v2/examples/propertystore/win32x
github.com/zzl/go-win32api/v2/examples/window_helloworld
# github.com/zzl/go-win32api/v2/examples/console_io
examples/console_io/console_io.go:73:4: cannot use &chBuffer[0] (value of type *win32.CHAR) as *byte value in argument to win32.ReadFile
examples/console_io/console_io.go:119:4: cannot use &chBuffer[0] (value of type *win32.CHAR) as *byte value in argument to win32.ReadFile
examples/console_io/console_io.go:125:4: cannot use &chBuffer[0] (value of type *win32.CHAR) as *byte value in argument to win32.WriteFile
# github.com/zzl/go-win32api/v2/examples/propertystore/win32x
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:368:6: PSEnumeratePropertyDescriptions already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/UI.Shell.PropertiesSystem.go:1771:6: other declaration of PSEnumeratePropertyDescriptions
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:542:6: PSPropertyBag_ReadPOINTS already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/UI.Shell.PropertiesSystem.go:1945:6: other declaration of PSPropertyBag_ReadPOINTS
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:560:6: PSPropertyBag_WriteRECTL already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/UI.Shell.PropertiesSystem.go:1963:6: other declaration of PSPropertyBag_WriteRECTL
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:668:6: InitPropVariantVectorFromPropVariant already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/wi
n32")
./win32/System.Com.StructuredStorage.go:2260:6: other declaration of InitPropVariantVectorFromPropVariant
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:848:6: PropVariantToBuffer already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/System.Com.StructuredStorage.go:2434:6: other declaration of PropVariantToBuffer
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:878:6: PropVariantToStrRet already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/UI.Shell.go:30343:6: other declaration of PropVariantToStrRet
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:890:6: PropVariantGetElementCount already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/System.Com.StructuredStorage.go:2470:6: other declaration of PropVariantGetElementCount
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:1147:6: InitVariantFromBooleanArray already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/System.Variant.go:747:6: other declaration of InitVariantFromBooleanArray
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:1225:6: VariantToUInt32WithDefault already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/System.Variant.go:825:6: other declaration of VariantToUInt32WithDefault
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:1429:6: VariantToUInt32ArrayAlloc already declared through dot-import of package win32 ("github.com/zzl/go-win32api/v2/win32")
./win32/System.Variant.go:1023:6: other declaration of VariantToUInt32ArrayAlloc
examples/propertystore/win32x/UI.Shell.PropertiesSystem.go:1225:6: too many errors
Which leads to this question:
There is both a examples/propertystore/win32x/UI.Shell.PropertiesSystem.go and a win32/UI.Shell.PropertiesSystem.go. The former doesn't appear to have been generated using the same code that generated the latter. How was this former file created?
FYI: I did get all the examples to compile from HEAD using https://github.com/rasa/go-winapi-gen/tree/rs/add-apis and https://github.com/rasa/go-win32api/tree/rs/add-apis . I can submit these as PRs, if you're interested.