Fix more Windows compiler errors

This commit is contained in:
Benjamin Schaaf 2019-01-16 10:23:25 +11:00
parent dd915e74b1
commit 7ef5c6686e
2 changed files with 59 additions and 4 deletions

View file

@ -50,7 +50,8 @@ final class PosixEventDriver(Loop : PosixEventLoop) : EventDriver {
else version (EventcoreUseGAIA) alias DNSDriver = EventDriverDNS_GAIA!(EventsDriver, SignalsDriver); else version (EventcoreUseGAIA) alias DNSDriver = EventDriverDNS_GAIA!(EventsDriver, SignalsDriver);
else alias DNSDriver = EventDriverDNS_GAI!(EventsDriver, SignalsDriver); else alias DNSDriver = EventDriverDNS_GAI!(EventsDriver, SignalsDriver);
alias FileDriver = ThreadedFileEventDriver!EventsDriver; 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; version (linux) alias WatcherDriver = InotifyEventDriverWatchers!EventsDriver;
//else version (OSX) alias WatcherDriver = FSEventsEventDriverWatchers!EventsDriver; //else version (OSX) alias WatcherDriver = FSEventsEventDriverWatchers!EventsDriver;
else alias WatcherDriver = PollEventDriverWatchers!EventsDriver; else alias WatcherDriver = PollEventDriverWatchers!EventsDriver;

View file

@ -10,12 +10,10 @@ import std.algorithm : min, max;
final class PosixEventDriverPipes(Loop : PosixEventLoop) : EventDriverPipes { final class PosixEventDriverPipes(Loop : PosixEventLoop) : EventDriverPipes {
@safe: /*@nogc:*/ nothrow: @safe: /*@nogc:*/ nothrow:
import core.stdc.errno : errno, EAGAIN, EINPROGRESS; import core.stdc.errno : errno, EAGAIN;
import core.sys.posix.signal;
import core.sys.posix.unistd : close, read, write; import core.sys.posix.unistd : close, read, write;
import core.sys.posix.fcntl; import core.sys.posix.fcntl;
import core.sys.posix.poll; import core.sys.posix.poll;
import core.sys.linux.sys.signalfd;
private Loop m_loop; 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 { package struct PipeSlot {
alias Handle = PipeFD; alias Handle = PipeFD;