From 7ef5c6686eba92631096a8e75fcba8b67011d656 Mon Sep 17 00:00:00 2001 From: Benjamin Schaaf Date: Wed, 16 Jan 2019 10:23:25 +1100 Subject: [PATCH] Fix more Windows compiler errors --- source/eventcore/drivers/posix/driver.d | 3 +- source/eventcore/drivers/posix/pipes.d | 60 +++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/source/eventcore/drivers/posix/driver.d b/source/eventcore/drivers/posix/driver.d index ef36e18..ac78bdb 100644 --- a/source/eventcore/drivers/posix/driver.d +++ b/source/eventcore/drivers/posix/driver.d @@ -50,7 +50,8 @@ final class PosixEventDriver(Loop : PosixEventLoop) : EventDriver { else version (EventcoreUseGAIA) alias DNSDriver = EventDriverDNS_GAIA!(EventsDriver, SignalsDriver); else alias DNSDriver = EventDriverDNS_GAI!(EventsDriver, SignalsDriver); alias FileDriver = ThreadedFileEventDriver!EventsDriver; - alias PipeDriver = PosixEventDriverPipes!Loop; + version (Posix) alias PipeDriver = PosixEventDriverPipes!Loop; + else alias PipeDriver = DummyEventDriverPipes!Loop; version (linux) alias WatcherDriver = InotifyEventDriverWatchers!EventsDriver; //else version (OSX) alias WatcherDriver = FSEventsEventDriverWatchers!EventsDriver; else alias WatcherDriver = PollEventDriverWatchers!EventsDriver; diff --git a/source/eventcore/drivers/posix/pipes.d b/source/eventcore/drivers/posix/pipes.d index 55812df..3ee6dec 100644 --- a/source/eventcore/drivers/posix/pipes.d +++ b/source/eventcore/drivers/posix/pipes.d @@ -10,12 +10,10 @@ import std.algorithm : min, max; final class PosixEventDriverPipes(Loop : PosixEventLoop) : EventDriverPipes { @safe: /*@nogc:*/ nothrow: - import core.stdc.errno : errno, EAGAIN, EINPROGRESS; - import core.sys.posix.signal; + import core.stdc.errno : errno, EAGAIN; import core.sys.posix.unistd : close, read, write; import core.sys.posix.fcntl; import core.sys.posix.poll; - import core.sys.linux.sys.signalfd; private Loop m_loop; @@ -322,6 +320,62 @@ final class PosixEventDriverPipes(Loop : PosixEventLoop) : EventDriverPipes { } } +final class DummyEventDriverPipes(Loop : PosixEventLoop) : EventDriverPipes { +@safe: /*@nogc:*/ nothrow: + this(Loop loop) {} + + override PipeFD adopt(int system_pipe_handle) + { + assert(false, "TODO!"); + } + + override void read(PipeFD pipe, ubyte[] buffer, IOMode mode, PipeIOCallback on_read_finish) + { + assert(false, "TODO!"); + } + + override void cancelRead(PipeFD pipe) + { + assert(false, "TODO!"); + } + + override void write(PipeFD pipe, const(ubyte)[] buffer, IOMode mode, PipeIOCallback on_write_finish) + { + assert(false, "TODO!"); + } + + override void cancelWrite(PipeFD pipe) + { + assert(false, "TODO!"); + } + + override void waitForData(PipeFD pipe, PipeIOCallback on_data_available) + { + assert(false, "TODO!"); + } + + override void close(PipeFD pipe) + { + assert(false, "TODO!"); + } + + override void addRef(PipeFD pid) + { + assert(false, "TODO!"); + } + + override bool releaseRef(PipeFD pid) + { + assert(false, "TODO!"); + } + + protected override void* rawUserData(PipeFD descriptor, size_t size, DataInitializer initialize, DataInitializer destroy) + @system { + assert(false, "TODO!"); + } +} + + package struct PipeSlot { alias Handle = PipeFD;