Closed russel closed 10 years ago
Yep, try an extra uintptr cast.
Hi,
Were you able to successfully build the gdk package with that change? I'd be willing to merge this (and the glib fix as well) once all the gotk3 packages compile.
I thought I had tried this, it succeeded and I had reported back, certainly I had made the edit. However clearly not. I have pulled to update which makes my stash edit useless :-( For various reasons, I am currently using Fedora 19 rather than Debian Unstable, and something is not working even with Google Go:
|> go install
# github.com/conformal/gotk3/gtk
37: error: 'gtk_window_close' undeclared (first use in this function)
You need to use build tags to target an older GTK release. For example, if you're using GTK 3.8, run:
go install -tags gtk_3_8
This is documented in the README.
Indeed. I should have remembered, sorry. Applying the one liner to the new master HEAD makes this compile oin Fedora 19 for both Google Go and GCCGO.
diff --git a/gdk/gdk.go b/gdk/gdk.go
index 1cf52ac..2a4bae7 100644
--- a/gdk/gdk.go
+++ b/gdk/gdk.go
@@ -84,7 +84,7 @@ type Atom uintptr
// Native() returns the underlying GdkAtom.
func (v Atom) Native() C.GdkAtom {
- return C.toGdkAtom(unsafe.Pointer(v))
+ return C.toGdkAtom(unsafe.Pointer(uintptr(v)))
}
/*
|> go install -compiler gccgo -gccgoflags -O3 github.com/conformal/gotk3/gtk
github.com/conformal/gotk3/gdk
github.com/conformal/gotk3/gdk/gdk.go:87:40: error: invalid type conversion (cannot use type Atom as type unsafe.Pointer) return C.toGdkAtom(unsafe.Pointer(v)) ^
Looks like a similar issue to the solved GLib one?