go-gl / glfw

Go bindings for GLFW 3
BSD 3-Clause "New" or "Revised" License
1.58k stars 181 forks source link

Remove warning/errors about undefined functions #399

Closed metal3d closed 6 months ago

metal3d commented 6 months ago

Fixes #359

features.h needs _GNU_SOURCE to be set to allow stdlib.h to declare the functions.

metal3d commented 6 months ago

fixes #359

Jacalz commented 6 months ago

Hmm. I have one idea. Given that those warnings on Wayland now are errors after the linker changes in Fedora 40 (I've confirmed what @metal3d saw), how about we just enable GNU_SOURCE for Wayland builds?

It's obviously just a short-term fix but it does improve things quite a bit. Anyone using Fedora 40 can then compile the binary (three errors become one warning) and everyone else gets one warning instead of three. Seems like a win until we manage to get all the warnings to disappear?

metal3d commented 6 months ago

I agree @Jacalz, this is critical on Fedora 40 and probably with others distributions that are up to date. Without this fix, it's impossible to build any Fyne application with Wayland support.

A warning isn't problematic as it's only an already defined directive. IMHO this shouldn't be a problem, even if the warning is fixed, later, in the glfw project.

Jacalz commented 6 months ago

Yeah, but given that there is no compilation problem on X11, I see not point in adding a new warning just for the sake of it. Would you mind keeping it enabled only for Wayland?

metal3d commented 6 months ago

FYI, I made the change to only set the directive to compile on Wayland. It is a very important fix that allows Fyne application to compile on Fedora 40.

Even if it's temporary, this fix is highly necessary.