Merge pull request #48 from dkgroot-dlang/master

Fix compilation on DragonFlyBSD
This commit is contained in:
Sönke Ludwig 2018-02-22 01:56:04 +01:00 committed by GitHub
commit e9df91f450
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -8,6 +8,7 @@ module eventcore.drivers.posix.kqueue;
@safe: /*@nogc:*/ nothrow: @safe: /*@nogc:*/ nothrow:
version (FreeBSD) enum have_kqueue = true; version (FreeBSD) enum have_kqueue = true;
else version (DragonFlyBSD) enum have_kqueue = true;
else version (OSX) enum have_kqueue = true; else version (OSX) enum have_kqueue = true;
else enum have_kqueue = false; else enum have_kqueue = false;
@ -21,6 +22,7 @@ import core.sys.posix.sys.time : timespec, time_t;
version (OSX) import core.sys.darwin.sys.event; version (OSX) import core.sys.darwin.sys.event;
else version (FreeBSD) import core.sys.freebsd.sys.event; else version (FreeBSD) import core.sys.freebsd.sys.event;
else version (DragonFlyBSD) import core.sys.dragonflybsd.sys.event;
else static assert(false, "Kqueue not supported on this OS."); else static assert(false, "Kqueue not supported on this OS.");

View file

@ -25,6 +25,7 @@ version (Posix) {
{ {
version (linux) enum O_CLOEXEC = 0x80000; version (linux) enum O_CLOEXEC = 0x80000;
else version (FreeBSD) enum O_CLOEXEC = 0x100000; else version (FreeBSD) enum O_CLOEXEC = 0x100000;
else version (DragonFlyBSD) enum O_CLOEXEC = 0x0020000;
else version (NetBSD) enum O_CLOEXEC = 0x400000; else version (NetBSD) enum O_CLOEXEC = 0x400000;
else version (OpenBSD) enum O_CLOEXEC = 0x10000; else version (OpenBSD) enum O_CLOEXEC = 0x10000;
else version (OSX) enum O_CLOEXEC = 0x1000000; else version (OSX) enum O_CLOEXEC = 0x1000000;
@ -57,6 +58,9 @@ version(FreeBSD) {
enum IP_MULTICAST_LOOP = 11; enum IP_MULTICAST_LOOP = 11;
} else import core.sys.freebsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP; } else import core.sys.freebsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
} }
version(DragonFlyBSD) {
import core.sys.dragonflybsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
}
version (Solaris) { version (Solaris) {
enum IP_ADD_MEMBERSHIP = 0x13; enum IP_ADD_MEMBERSHIP = 0x13;
enum IP_MULTICAST_LOOP = 0x12; enum IP_MULTICAST_LOOP = 0x12;