X11: Place argument assertion after platform check

This lets automated testing check that GLFW_NOT_INITIALIZED is emitted
for every public function.
This commit is contained in:
Camilla Löwy 2026-01-06 20:12:48 +01:00
parent 9352d8fe93
commit 96e0f49395

View File

@ -3344,8 +3344,6 @@ GLFWAPI Window glfwGetX11Window(GLFWwindow* handle)
GLFWAPI void glfwSetX11SelectionString(const char* string) GLFWAPI void glfwSetX11SelectionString(const char* string)
{ {
assert(string != NULL);
_GLFW_REQUIRE_INIT(); _GLFW_REQUIRE_INIT();
if (_glfw.platform.platformID != GLFW_PLATFORM_X11) if (_glfw.platform.platformID != GLFW_PLATFORM_X11)
@ -3354,6 +3352,8 @@ GLFWAPI void glfwSetX11SelectionString(const char* string)
return; return;
} }
assert(string != NULL);
_glfw_free(_glfw.x11.primarySelectionString); _glfw_free(_glfw.x11.primarySelectionString);
_glfw.x11.primarySelectionString = _glfw_strdup(string); _glfw.x11.primarySelectionString = _glfw_strdup(string);