From 4c68aff164b51f928f286589255987cf8e692c4b Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Thu, 17 May 2007 15:50:20 +0100 Subject: [PATCH] Rename the SocketErrno enumeration values, from ESOMETHING to ERROR_SOMETHING, to avoid conflict with errno #define's; fixes compilation in mingw32. --- src/internet-node/udp-socket.cc | 10 +++++----- src/node/socket.h | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/internet-node/udp-socket.cc b/src/internet-node/udp-socket.cc index 8c6c3dcfc..dd58652ad 100644 --- a/src/internet-node/udp-socket.cc +++ b/src/internet-node/udp-socket.cc @@ -30,7 +30,7 @@ UdpSocket::UdpSocket (Ptr node, Ptr udp) : m_endPoint (0), m_node (node), m_udp (udp), - m_errno (ENOTERROR), + m_errno (ERROR_NOTERROR), m_shutdownSend (false), m_shutdownRecv (false), m_connected (false) @@ -154,7 +154,7 @@ UdpSocket::DoAccept(ns3::Callback, const Ipv4Address&, uint16_ ns3::Callback > closeRequested) { // calling accept on a udp socket is a programming error. - m_errno = EOPNOTSUPP; + m_errno = ERROR_OPNOTSUPP; return -1; } int @@ -164,7 +164,7 @@ UdpSocket::DoSend (const uint8_t* buffer, { if (!m_connected) { - m_errno = ENOTCONN; + m_errno = ERROR_NOTCONN; return -1; } Packet p; @@ -193,7 +193,7 @@ UdpSocket::DoSendPacketTo (const Packet &p, Ipv4Address daddr, uint16_t dport, } if (m_shutdownSend) { - m_errno = ESHUTDOWN; + m_errno = ERROR_SHUTDOWN; return -1; } m_udp->Send (p, m_endPoint->GetLocalAddress (), daddr, @@ -213,7 +213,7 @@ UdpSocket::DoSendTo(const Ipv4Address &address, { if (m_connected) { - m_errno = EISCONN; + m_errno = ERROR_ISCONN; return -1; } Packet p; diff --git a/src/node/socket.h b/src/node/socket.h index ee710ca75..1c352e166 100644 --- a/src/node/socket.h +++ b/src/node/socket.h @@ -46,13 +46,13 @@ public: virtual ~Socket(); enum SocketErrno { - ENOTERROR, - EISCONN, - ENOTCONN, - EMSGSIZE, - EAGAIN, - ESHUTDOWN, - EOPNOTSUPP, + ERROR_NOTERROR, + ERROR_ISCONN, + ERROR_NOTCONN, + ERROR_MSGSIZE, + ERROR_AGAIN, + ERROR_SHUTDOWN, + ERROR_OPNOTSUPP, SOCKET_ERRNO_LAST };