go-gl-legacy / glfw

Go bindings for libglfw 2.x
http://www.glfw.org
BSD 3-Clause "New" or "Revised" License
73 stars 8 forks source link

Symbols in callback.c need to be globally unique #26

Closed pwaller closed 12 years ago

pwaller commented 12 years ago

This is a minor issue, but I found myself accidentally using the glfw from @jteeuwen's personal repository and the one here, and my binary would suddenly not compile with the error "Duplicate symbol", without telling me where the duplicate was coming from. Apart from maybe ameliorating this problem, if anyone happens to link in something with any of the function names in callback.c, they will get this error.

I guess they would have to be using cgo, but still. Maybe we could make them a bit more unqiue by prepending glfw·, in a similar fashion to go's runtime?

ghost commented 12 years ago

This is addressed in pull request https://github.com/go-gl/glfw/pull/27

Using the middle-dot (glfw·xxx) as was suggested by you, is not possible here. The Go code-base uses a custom C compiler, inspired by the Plan9 toolchain. It allows unicode symbols in identifiers. CGO projects use GCC, which does not allow this.