Fix GLFW runtime platform detection

This commit is contained in:
M374LX 2024-03-09 18:36:46 -03:00
commit a609b3a8e8

View file

@ -35,7 +35,7 @@
// _GLFW_WAYLAND to use the Wayland API (experimental and incomplete)
// _GLFW_COCOA to use the Cocoa frameworks
//
// Note: GLFW's runtime platform selection is not supported at the moment
// On Linux, _GLFW_X11 and _GLFW_WAYLAND can be combined
//----------------------------------------------------------------------------------
// Feature Test Macros required for this module
@ -53,8 +53,8 @@
#define _GLFW_WIN32
#endif
#if defined(__linux__)
#if !defined(_GLFW_WAYLAND) // Required for Wayland windowing
#define _GLFW_X11
#if !defined(_GLFW_WAYLAND) && !defined(_GLFW_X11)
#error "Cannot disable Wayland and X11 at the same time"
#endif
#endif
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
@ -69,15 +69,6 @@
#define _WIN32_WINNT_WINXP 0x0501
#endif
#include "external/glfw/src/internal.h"
// We do not use GLFW's "null" platform, but the absence of this function
// causes the build to fail
GLFWbool _glfwConnectNull(int platformID, _GLFWplatform* platform)
{
return GLFW_TRUE;
}
// Common modules to all platforms
#include "external/glfw/src/init.c"
#include "external/glfw/src/platform.c"