cmd/cgo,cmd/fix,misc/cgo: map the EGLConfig C type to uintptr in Go

Similarly to EGLDisplay, EGLConfig is declared as a pointer but may
contain non-pointer values.

I believe this is the root cause of https://todo.sr.ht/~eliasnaur/gio/121.

Change-Id: I412c4fbc2eef4aa028534d68bda95db98e3a365d
Reviewed-on: https://go-review.googlesource.com/c/go/+/235817
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Elias Naur 2020-05-30 16:34:23 +02:00
parent f1f8f9af9a
commit 7dbbb5bacf
6 changed files with 117 additions and 76 deletions

View file

@ -3029,7 +3029,7 @@ func (c *typeConv) badPointerTypedef(dt *dwarf.TypedefType) bool {
if c.badJNI(dt) {
return true
}
if c.badEGLDisplay(dt) {
if c.badEGLType(dt) {
return true
}
return false
@ -3168,11 +3168,11 @@ func (c *typeConv) badJNI(dt *dwarf.TypedefType) bool {
return false
}
func (c *typeConv) badEGLDisplay(dt *dwarf.TypedefType) bool {
if dt.Name != "EGLDisplay" {
func (c *typeConv) badEGLType(dt *dwarf.TypedefType) bool {
if dt.Name != "EGLDisplay" && dt.Name != "EGLConfig" {
return false
}
// Check that the typedef is "typedef void *EGLDisplay".
// Check that the typedef is "typedef void *<name>".
if ptr, ok := dt.Type.(*dwarf.PtrType); ok {
if _, ok := ptr.Type.(*dwarf.VoidType); ok {
return true