Place assertions for handles after init check

This lets automated testing check that GLFW_NOT_INITIALIZED is emitted
for every public function.
This commit is contained in:
Camilla Löwy
2024-01-18 21:33:27 +01:00
parent 38ec7abd3b
commit 68dcea0d7f
18 changed files with 226 additions and 180 deletions
+3 -3
View File
@@ -3302,9 +3302,6 @@ GLFWAPI Display* glfwGetX11Display(void)
GLFWAPI Window glfwGetX11Window(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
assert(window != NULL);
_GLFW_REQUIRE_INIT_OR_RETURN(None);
if (_glfw.platform.platformID != GLFW_PLATFORM_X11)
@@ -3313,6 +3310,9 @@ GLFWAPI Window glfwGetX11Window(GLFWwindow* handle)
return None;
}
_GLFWwindow* window = (_GLFWwindow*) handle;
assert(window != NULL);
return window->x11.handle;
}