From bbf661ca381b2319cebf1d1d4d97d1841699296a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 11 Jan 2024 22:22:31 +0100 Subject: [PATCH] Replace comments with designated initializers We can finally have the compiler verify that the values go to the correct struct member. With this commit GLFW no longer compiles with Visual Studio 2012 or earlier. If you must compile GLFW on Windows XP, check out MinGW-w64. Fixes #2465 --- src/init.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/init.c b/src/init.c index 2db542f7..2b903146 100644 --- a/src/init.c +++ b/src/init.c @@ -49,19 +49,22 @@ static GLFWerrorfun _glfwErrorCallback; static GLFWallocator _glfwInitAllocator; static _GLFWinitconfig _glfwInitHints = { - GLFW_TRUE, // hat buttons - GLFW_ANGLE_PLATFORM_TYPE_NONE, // ANGLE backend - GLFW_ANY_PLATFORM, // preferred platform - NULL, // vkGetInstanceProcAddr function + .hatButtons = GLFW_TRUE, + .angleType = GLFW_ANGLE_PLATFORM_TYPE_NONE, + .platformID = GLFW_ANY_PLATFORM, + .vulkanLoader = NULL, + .ns = { - GLFW_TRUE, // macOS menu bar - GLFW_TRUE // macOS bundle chdir + .menubar = GLFW_TRUE, + .chdir = GLFW_TRUE }, + .x11 = { - GLFW_TRUE, // X11 XCB Vulkan surface + .xcbVulkanSurface = GLFW_TRUE, }, + .wl = { - GLFW_WAYLAND_PREFER_LIBDECOR // Wayland libdecor mode + .libdecorMode = GLFW_WAYLAND_PREFER_LIBDECOR }, };