Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: Represent GLsync as uintptr, not unsafe.Pointer. #72

Closed
wants to merge 1 commit into from

Conversation

dmitshur
Copy link
Member

@dmitshur dmitshur commented May 9, 2017

Regenerate all bindings after generator change in go-gl/glow#79.

Done with latest version of glow:

go generate -tags=gen github.com/go-gl/gl

Resolves #71.

/cc @errcw @dominikh

Regenerate all bindings after generator change in go-gl/glow#79.

Done with latest version of glow:

	go generate -tags=gen github.com/go-gl/gl

Resolves #71.
@dmitshur dmitshur requested a review from errcw May 9, 2017 04:00
@errcw
Copy link
Member

errcw commented May 9, 2017

LGTM, should merge pending Travis build confirmation.

@dmitshur
Copy link
Member Author

dmitshur commented May 9, 2017

It fails to compile:

$ go test ./v4.5-core/gl
# github.com/go-gl/gl/v4.5-core/gl
v4.5-core/gl/package.go:5490: cannot convert sync (type uintptr) to type C.GLsync
v4.5-core/gl/package.go:5662: cannot convert ret (type C.GLsync) to type uintptr
v4.5-core/gl/package.go:5766: cannot convert sync (type uintptr) to type C.GLsync
v4.5-core/gl/package.go:5972: cannot convert ret (type C.GLsync) to type uintptr
v4.5-core/gl/package.go:6480: cannot convert sync (type uintptr) to type C.GLsync
v4.5-core/gl/package.go:6803: cannot convert sync (type uintptr) to type C.GLsync
v4.5-core/gl/package.go:8205: cannot convert sync (type uintptr) to type C.GLsync

@errcw
Copy link
Member

errcw commented May 9, 2017

Alas. Go is unhappy converting between uintptr and a C pointer type. Which is a little strange because we're already doing the same thing for GLhandleARB which maps to void * on Mac OS. Maybe void* is special compared to an anonymous struct pointer?

It might be safe to do a just-in-time conversion from uintptr to unsafe.Pointer (but the GC may still catch this at exactly the wrong moment)? Alternatively we could change the C function signature and cast the value there, though that's not yet well supported by glow.

@errcw
Copy link
Member

errcw commented Feb 20, 2018

Dropping this PR given we implemented a slightly different fix in Glow.

@errcw errcw closed this Feb 20, 2018
@dmitshur dmitshur deleted the regenerate-glow-79 branch March 4, 2018 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants