]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/datagramsocket.cpp
Use the correct #ifdef for Windows
[libs/net.git] / source / net / datagramsocket.cpp
index 664c2659de69ec43eaf9a0a0097d77522e84f58a..0e405d6f0cb7972fed62e418d447a2dc4c303b31 100644 (file)
@@ -1,4 +1,4 @@
-#ifdef WIN32
+#ifdef _WIN32
 #include <winsock2.h>
 #endif
 #include <cerrno>
@@ -15,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);
@@ -28,7 +28,7 @@ bool DatagramSocket::connect(const SockAddr &addr)
        int err = ::connect(priv->handle, reinterpret_cast<sockaddr *>(&sa.addr), sa.size);
        if(err==-1)
        {
-#ifdef WIN32
+#ifdef _WIN32
                throw system_error("connect", WSAGetLastError());
 #else
                throw system_error("connect");
@@ -62,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");
@@ -86,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");