From cd8d90b5c424990872e906419da1b0f8d008d557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 12 Jan 2021 18:40:58 +0100 Subject: [PATCH 1/3] Fix 32-bit compilation error. --- source/eventcore/drivers/threadedfile.d | 36 ++++++++++++++----------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/source/eventcore/drivers/threadedfile.d b/source/eventcore/drivers/threadedfile.d index 485fd83..728e959 100644 --- a/source/eventcore/drivers/threadedfile.d +++ b/source/eventcore/drivers/threadedfile.d @@ -225,25 +225,29 @@ final class ThreadedFileEventDriver(Events : EventDriverEvents) : EventDriverFil } on_finish(file, IOStatus.ok, 0); } else version (Windows) { - import core.sys.windows.windows : FILE_BEGIN, HANDLE, INVALID_HANDLE_VALUE, - LARGE_INTEGER, SetFilePointerEx, SetEndOfFile; - import core.stdc.stdio : _get_osfhandle; + version (Win64) { + import core.sys.windows.windows : FILE_BEGIN, HANDLE, INVALID_HANDLE_VALUE, + LARGE_INTEGER, SetFilePointerEx, SetEndOfFile; + import core.stdc.stdio : _get_osfhandle; - auto h = () @trusted { return cast(HANDLE)_get_osfhandle(cast(int)file); } (); - if (h == INVALID_HANDLE_VALUE) { + auto h = () @trusted { return cast(HANDLE)_get_osfhandle(cast(int)file); } (); + if (h == INVALID_HANDLE_VALUE) { + on_finish(file, IOStatus.error, 0); + return; + } + LARGE_INTEGER ls = { QuadPart: size }; + if (!() @trusted { return SetFilePointerEx(h, ls, null, FILE_BEGIN); } ()) { + on_finish(file, IOStatus.error, 0); + return; + } + if (!() @trusted { return SetEndOfFile(h); } ()) { + on_finish(file, IOStatus.error, 0); + return; + } + on_finish(file, IOStatus.ok, 0); + } else { on_finish(file, IOStatus.error, 0); - return; } - LARGE_INTEGER ls = { QuadPart: size }; - if (!() @trusted { return SetFilePointerEx(h, ls, null, FILE_BEGIN); } ()) { - on_finish(file, IOStatus.error, 0); - return; - } - if (!() @trusted { return SetEndOfFile(h); } ()) { - on_finish(file, IOStatus.error, 0); - return; - } - on_finish(file, IOStatus.ok, 0); } else { on_finish(file, IOStatus.error, 0); } From 4c772629f26122b687680489bdf7305513e0c000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 12 Jan 2021 18:59:52 +0100 Subject: [PATCH 2/3] Remove support for OPTLINK builds. This didn't link anyway and since 64-bit compilation is the default for DMD nowadays, there is no reason whatsoever to keep supporting it. --- dub.sdl | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/dub.sdl b/dub.sdl index 40d503a..aae914f 100644 --- a/dub.sdl +++ b/dub.sdl @@ -36,27 +36,15 @@ configuration "kqueue" { } configuration "winapi" { - platforms "windows-x86_64" "windows-x86_mscoff" "windows-ldc" "windows-gdc" + platforms "windows" versions "EventcoreWinAPIDriver" } configuration "select" { - platforms "posix" "windows-x86_64" "windows-x86_mscoff" + platforms "posix" "windows" versions "EventcoreSelectDriver" } -configuration "winapi-optlink" { - platforms "windows-x86-dmd" - versions "EventcoreWinAPIDriver" - sourceFiles "lib/ws2_32.lib" "lib/kernel32.lib" -} - -configuration "select-optlink" { - platforms "windows-x86-dmd" - versions "EventcoreSelectDriver" - sourceFiles "lib/ws2_32.lib" "lib/kernel32.lib" -} - configuration "libasync" { dependency "libasync" version="~>0.8.2" versions "EventcoreLibasyncDriver" From 3b7a46d14cabead624e7ef9ffdcc36cb0236ef30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 12 Jan 2021 18:41:08 +0100 Subject: [PATCH 3/3] Test 32-bit Windows build. --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5ae20b..b180254 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,9 @@ jobs: - {os: windows-latest, dc: ldc-1.9.0, config: select} - {os: windows-latest, dc: ldc-1.17.0} - {os: ubuntu-latest, dc: ldc-1.17.0} + include: + - {os: windows-latest, dc: ldc-latest, arch: x86, config: winapi} + - {os: windows-latest, dc: dmd-latest, arch: x86_mscoff, config: winapi} runs-on: ${{ matrix.os }} steps: