Merge pull request #22 from wilzbach/remove-stdc
Remove deprecated stdc import merged-on-behalf-of: Sebastian Wilzbach <wilzbach@users.noreply.github.com>
This commit is contained in:
commit
cb169b8502
|
@ -1264,7 +1264,7 @@ shared static this()
|
||||||
static if (need_wsa) {
|
static if (need_wsa) {
|
||||||
logTrace("init winsock");
|
logTrace("init winsock");
|
||||||
// initialize WinSock2
|
// initialize WinSock2
|
||||||
import std.c.windows.winsock;
|
import core.sys.windows.winsock2;
|
||||||
WSADATA data;
|
WSADATA data;
|
||||||
WSAStartup(0x0202, &data);
|
WSAStartup(0x0202, &data);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ NetworkAddress resolveHost(string host, AddressFamily address_family = AddressFa
|
||||||
NetworkAddress resolveHost(string host, ushort address_family, bool use_dns = true)
|
NetworkAddress resolveHost(string host, ushort address_family, bool use_dns = true)
|
||||||
{
|
{
|
||||||
import std.socket : parseAddress;
|
import std.socket : parseAddress;
|
||||||
version (Windows) import std.c.windows.winsock : sockaddr_in, sockaddr_in6;
|
version (Windows) import core.sys.windows.winsock2 : sockaddr_in, sockaddr_in6;
|
||||||
else import core.sys.posix.netinet.in_ : sockaddr_in, sockaddr_in6;
|
else import core.sys.posix.netinet.in_ : sockaddr_in, sockaddr_in6;
|
||||||
|
|
||||||
enforce(host.length > 0, "Host name must not be empty.");
|
enforce(host.length > 0, "Host name must not be empty.");
|
||||||
|
|
Loading…
Reference in a new issue