Remove some always-true conditions (versions not supported anymore)
This commit is contained in:
parent
e564bba215
commit
26060a6e0b
|
@ -191,13 +191,7 @@ final class PosixEventDriverCore(Loop : PosixEventLoop, Timers : EventDriverTime
|
||||||
m_events = events;
|
m_events = events;
|
||||||
m_processes = processes;
|
m_processes = processes;
|
||||||
m_wakeupEvent = events.createInternal();
|
m_wakeupEvent = events.createInternal();
|
||||||
|
m_threadCallbackMutex = mallocT!(shared(Mutex));
|
||||||
static if (__VERSION__ >= 2074)
|
|
||||||
m_threadCallbackMutex = mallocT!(shared(Mutex));
|
|
||||||
else {
|
|
||||||
() @trusted { m_threadCallbackMutex = cast(shared)mallocT!Mutex; } ();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_threadCallbacks = mallocT!(ConsumableQueue!ThreadCallbackEntry);
|
m_threadCallbacks = mallocT!(ConsumableQueue!ThreadCallbackEntry);
|
||||||
m_threadCallbacks.reserve(1000);
|
m_threadCallbacks.reserve(1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,13 +42,7 @@ version (linux) {
|
||||||
static if (!is(typeof(SOCK_CLOEXEC)))
|
static if (!is(typeof(SOCK_CLOEXEC)))
|
||||||
enum SOCK_CLOEXEC = 0x80000;
|
enum SOCK_CLOEXEC = 0x80000;
|
||||||
|
|
||||||
static if (__VERSION__ < 2077)
|
import core.sys.linux.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
|
||||||
{
|
|
||||||
enum IP_ADD_MEMBERSHIP = 35;
|
|
||||||
enum IP_MULTICAST_LOOP = 34;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
import core.sys.linux.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
|
|
||||||
|
|
||||||
// Linux-specific TCP options
|
// Linux-specific TCP options
|
||||||
// https://github.com/torvalds/linux/blob/master/include/uapi/linux/tcp.h#L95
|
// https://github.com/torvalds/linux/blob/master/include/uapi/linux/tcp.h#L95
|
||||||
|
@ -65,18 +59,12 @@ version (linux) {
|
||||||
enum TCP_USER_TIMEOUT = 18;
|
enum TCP_USER_TIMEOUT = 18;
|
||||||
}
|
}
|
||||||
version (OSX) {
|
version (OSX) {
|
||||||
static if (__VERSION__ < 2077) {
|
import core.sys.darwin.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
|
||||||
enum IP_ADD_MEMBERSHIP = 12;
|
|
||||||
enum IP_MULTICAST_LOOP = 11;
|
|
||||||
} else import core.sys.darwin.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
|
|
||||||
|
|
||||||
static if (!is(typeof(ESHUTDOWN))) enum ESHUTDOWN = 58;
|
static if (!is(typeof(ESHUTDOWN))) enum ESHUTDOWN = 58;
|
||||||
}
|
}
|
||||||
version (FreeBSD) {
|
version (FreeBSD) {
|
||||||
static if (__VERSION__ < 2077) {
|
import core.sys.freebsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
|
||||||
enum IP_ADD_MEMBERSHIP = 12;
|
|
||||||
enum IP_MULTICAST_LOOP = 11;
|
|
||||||
} else import core.sys.freebsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
|
|
||||||
}
|
}
|
||||||
version (DragonFlyBSD) {
|
version (DragonFlyBSD) {
|
||||||
import core.sys.dragonflybsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
|
import core.sys.dragonflybsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
|
||||||
|
|
|
@ -13,10 +13,7 @@ version (Posix) {
|
||||||
import core.sys.posix.unistd;
|
import core.sys.posix.unistd;
|
||||||
}
|
}
|
||||||
version (Windows) {
|
version (Windows) {
|
||||||
static if (__VERSION__ >= 2070)
|
import core.sys.windows.stat;
|
||||||
import core.sys.windows.stat;
|
|
||||||
else
|
|
||||||
import std.c.windows.stat;
|
|
||||||
|
|
||||||
private {
|
private {
|
||||||
// TODO: use CreateFile/HANDLE instead of the Posix API on Windows
|
// TODO: use CreateFile/HANDLE instead of the Posix API on Windows
|
||||||
|
|
|
@ -45,12 +45,7 @@ final class WinAPIEventDriverCore : EventDriverCore {
|
||||||
m_fileCompletionEvent = () @trusted { return CreateEventW(null, false, false, null); } ();
|
m_fileCompletionEvent = () @trusted { return CreateEventW(null, false, false, null); } ();
|
||||||
registerEvent(m_fileCompletionEvent);
|
registerEvent(m_fileCompletionEvent);
|
||||||
m_ioEvents = mallocT!(ConsumableQueue!IOEvent);
|
m_ioEvents = mallocT!(ConsumableQueue!IOEvent);
|
||||||
|
m_threadCallbackMutex = mallocT!(shared(Mutex));
|
||||||
static if (__VERSION__ >= 2074)
|
|
||||||
m_threadCallbackMutex = mallocT!(shared(Mutex));
|
|
||||||
else {
|
|
||||||
() @trusted { m_threadCallbackMutex = cast(shared)mallocT!Mutex; } ();
|
|
||||||
}
|
|
||||||
m_threadCallbacks = mallocT!(ConsumableQueue!ThreadCallbackEntry);
|
m_threadCallbacks = mallocT!(ConsumableQueue!ThreadCallbackEntry);
|
||||||
m_threadCallbacks.reserve(1000);
|
m_threadCallbacks.reserve(1000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue