Don't merge until publication of Golang v1.16: GtkAccelKey v1.16 issue fix #687
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please do not merge this PR until the official release of the public version of Golang 1.16.
As the current version of Golang 1.16 is still in beta (until February), further changes can be added until its public release.
This PR fixes the problem with the GtkAccelKey declaration described below.
Its purpose is to help users, like me, who want to test future v1.16 functionality, while using the gotk3 library, and to facilitate discussion about this to make this solution the best it can be for everyone.
GtkAccelKey and Golang 1.16 issue
altered file: 'accel.go'
Golang 1.16 - Cgo changes Go 1.16 Release Notes - The Go Programming Language:
The cgo tool will no longer try to translate C struct bitfields into Go struct fields, even if their size can be represented in Go. The order in which C bitfields appear in memory is implementation dependent, so in some cases the cgo tool produced results that were silently incorrect.
'C' struct definition:
Cgo compilation errors:
../../gotk3/gotk3/gtk/accel.go:264:5: val.accel_flags undefined (type _Ctype_struct__GtkAccelKey has no field or method accel_flags) ../../gotk3/gotk3/gtk/accel.go:273:22: obj.accel_flags undefined (type *_Ctype_struct__GtkAccelKey has no field or method accel_flags)
Solution:
Need new declaration for GtkAccelKey structure that does not explicitly access to 'accel_flags'.
'accel_flags' value remain accessible using bitwise operations.