conformal / gotk3

Go bindings for GTK3
ISC License
470 stars 81 forks source link

Cannot build glib using gccgo on Debian Unstable #19

Closed russel closed 11 years ago

russel commented 11 years ago

Building using the 3.8 tag on Debian Unstable with the default toolchain seems to work fine. However trying to us GCCGO leads to the following:

|> go install -compiler gccgo -gccgoflags -O3 -tags gtk_3_8 github.com/conformal/gotk3/gtk

github.com/conformal/gotk3/glib

../github.com/conformal/gotk3/glib/glib.go:157:54: error: invalid type conversion (cannot use type CallbackArg as type unsafe.Pointer) return C.GoString((*C.char)(unsafe.Pointer(c))) ^

jrick commented 11 years ago

Can you try first type converting the CallbackArg to a uintptr, and see if that works?

return C.GoString((*C.char)(unsafe.Pointer(uintptr(c))))

russel commented 11 years ago

Compiles fine with that change.

jrick commented 11 years ago

The glib package should build fine without this change now. The code was reworked to change how callbacks work, and the CallbackArg type is no longer used. Let me know if there is any more code that sneaks in that breaks the build on gccgo.