Compile fixes.
This commit is contained in:
parent
1edfc88e63
commit
ed8b33786b
|
@ -273,7 +273,7 @@ struct NetworkAddress {
|
||||||
case AddressFamily.UNIX:
|
case AddressFamily.UNIX:
|
||||||
this.family = AddressFamily.UNIX;
|
this.family = AddressFamily.UNIX;
|
||||||
assert(addr.nameLen >= sockaddr_un.sizeof);
|
assert(addr.nameLen >= sockaddr_un.sizeof);
|
||||||
this.sockAddrUnix = *cast(sockaddr_un*)addr.name;
|
*this.sockAddrUnix = *cast(sockaddr_un*)addr.name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,10 +378,11 @@ struct NetworkAddress {
|
||||||
version (Posix) {
|
version (Posix) {
|
||||||
case AddressFamily.UNIX:
|
case AddressFamily.UNIX:
|
||||||
import std.traits : hasMember;
|
import std.traits : hasMember;
|
||||||
|
import std.string : fromStringz;
|
||||||
static if (hasMember!(sockaddr_un, "sun_len"))
|
static if (hasMember!(sockaddr_un, "sun_len"))
|
||||||
sink.formattedWrite("%s",() @trusted { return cast(char[])addr_unix.sun_path[0..addr_unix.sun_len]; } ());
|
sink(() @trusted { return cast(char[])addr_unix.sun_path[0..addr_unix.sun_len]; } ());
|
||||||
else
|
else
|
||||||
sink.formattedWrite("%s",() @trusted { return (cast(char*)addr_unix.sun_path.ptr).fromStringz; } ());
|
sink(() @trusted { return (cast(char*)addr_unix.sun_path.ptr).fromStringz; } ());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue