From 30a6f0539bdb06f1c56a26913e04520689f8e2b3 Mon Sep 17 00:00:00 2001 From: Dennis Korpel Date: Mon, 3 Jul 2023 11:00:51 +0200 Subject: [PATCH] Remove version(all) and fix older compilers --- source/glfw3/internal.d | 4 +++- source/glfw3/package.d | 20 +++++++++----------- source/glfw3/win32_platform.d | 5 +++-- source/glfw3/x11_platform.d | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/source/glfw3/internal.d b/source/glfw3/internal.d index ee7b5dd..81587aa 100644 --- a/source/glfw3/internal.d +++ b/source/glfw3/internal.d @@ -477,7 +477,9 @@ struct _GLFWmutex } // Don't want to emit 137Kb init symbol -static assert(__traits(isZeroInit, _GLFWlibrary), _GLFWlibrary.init); +static if (__VERSION__ >= 2100) { + static assert(__traits(isZeroInit, _GLFWlibrary), _GLFWlibrary.init); +} // Library global data // diff --git a/source/glfw3/package.d b/source/glfw3/package.d index 2f1d858..daaedb2 100644 --- a/source/glfw3/package.d +++ b/source/glfw3/package.d @@ -5,17 +5,15 @@ public { import glfw3.apinative; } -version(all) { - import glfw3.context; - import glfw3.init; - import glfw3.input; - import glfw3.monitor; - import glfw3.vulkan; - import glfw3.window; - import glfw3.mappings; - import glfw3.internal; - import glfw3.api; -} +import glfw3.context; +import glfw3.init; +import glfw3.input; +import glfw3.monitor; +import glfw3.vulkan; +import glfw3.window; +import glfw3.mappings; +import glfw3.internal; +import glfw3.api; version(_GLFW_WAYLAND) { import glfw3.wl_platform; diff --git a/source/glfw3/win32_platform.d b/source/glfw3/win32_platform.d index 4652bfc..e0abe74 100644 --- a/source/glfw3/win32_platform.d +++ b/source/glfw3/win32_platform.d @@ -284,9 +284,10 @@ struct _GLFWlibraryWin32 { char* clipboardString; int[512] keycodes; int[GLFW_KEY_LAST + 1] scancodes; - char[5][GLFW_KEY_LAST + 1] keynames; + char[5][GLFW_KEY_LAST + 1] keynames = void; // Where to place the cursor when re-enabled - double restoreCursorPosX;double restoreCursorPosY; + double restoreCursorPosX = 0.0; + double restoreCursorPosY = 0.0; // The window whose disabled cursor mode is active _GLFWwindow* disabledCursorWindow; RAWINPUT* rawInput; diff --git a/source/glfw3/x11_platform.d b/source/glfw3/x11_platform.d index 4013aef..c2249a3 100644 --- a/source/glfw3/x11_platform.d +++ b/source/glfw3/x11_platform.d @@ -247,7 +247,7 @@ struct _GLFWlibraryX11 { // Clipboard string (while the selection is owned) char* clipboardString; // Key name string - char[5][GLFW_KEY_LAST + 1] keynames = '\0'; + char[5][GLFW_KEY_LAST + 1] keynames = void; // ='\0'; older dmd versions can't initialize 2D static array with element // X11 keycode to GLFW key LUT int[256] keycodes; // GLFW key to X11 keycode LUT