glfw/glfw

Avoid multiple static functions with the same name

M374LX opened this issue · 0 comments

Update: #2462 addresses this issue.

There is a file in raylib named rglfw.c, which combines all of GLFW's source files into one: https://github.com/raysan5/raylib/blob/master/src/rglfw.c

The idea of combining all source files into one worked well when GLFW could be build for only one platform at a time. With the runtime platform selection introduced in 3.4, however, it is no longer possible because of the static functions for different platforms using the same name, like acquireMonitor(). Similarly, we cannot include the "null" platform alongside other platforms.

This problem can be fixed by simply avoiding multiple functions (and possibly also variables) with the same name even if they are static. For example, there could be suffixes for the platform, like acquireMonitorX11(), acquireMonitorWayland(), acquireMonitorNull(), and so on. As these functions are internal, this will not break the API.