mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
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:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user