X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fdatagramsocket.cpp;h=0e405d6f0cb7972fed62e418d447a2dc4c303b31;hb=6f6845971a21c2d7e04b87925f5e657f0f20ca0d;hp=d24ca4e1ec8ec1c10fcd11c3188da874426b053b;hpb=debe1004676d5431e571d9c4361072661dcc88c4;p=libs%2Fnet.git diff --git a/source/net/datagramsocket.cpp b/source/net/datagramsocket.cpp index d24ca4e..0e405d6 100644 --- a/source/net/datagramsocket.cpp +++ b/source/net/datagramsocket.cpp @@ -1,3 +1,6 @@ +#ifdef _WIN32 +#include +#endif #include #include #include @@ -12,7 +15,7 @@ namespace Net { DatagramSocket::DatagramSocket(Family f, int p): ClientSocket(f, SOCK_DGRAM, p) { -#ifdef WIN32 +#ifdef _WIN32 WSAEventSelect(priv->handle, *priv->event, FD_READ|FD_CLOSE); #endif set_events(IO::P_INPUT); @@ -25,7 +28,7 @@ bool DatagramSocket::connect(const SockAddr &addr) int err = ::connect(priv->handle, reinterpret_cast(&sa.addr), sa.size); if(err==-1) { -#ifdef WIN32 +#ifdef _WIN32 throw system_error("connect", WSAGetLastError()); #else throw system_error("connect"); @@ -59,7 +62,7 @@ unsigned DatagramSocket::sendto(const char *buf, unsigned size, const SockAddr & return 0; else { -#ifdef WIN32 +#ifdef _WIN32 throw system_error("sendto", WSAGetLastError()); #else throw system_error("sendto"); @@ -83,7 +86,7 @@ unsigned DatagramSocket::recvfrom(char *buf, unsigned size, SockAddr *&from_addr return 0; else { -#ifdef WIN32 +#ifdef _WIN32 throw system_error("recvfrom", WSAGetLastError()); #else throw system_error("recvfrom");