Rename the SocketErrno enumeration values, from ESOMETHING to ERROR_SOMETHING, to avoid conflict with errno #define's; fixes compilation in mingw32.
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Thu, 17 May 2007 15:50:20 +0100
changeset 646 f7475a7c5ae6
parent 645 07fc20ad3925
child 647 04f34a8befb8
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
src/node/socket.h
--- a/src/internet-node/udp-socket.cc	Thu May 17 15:15:56 2007 +0100
+++ b/src/internet-node/udp-socket.cc	Thu May 17 15:50:20 2007 +0100
@@ -30,7 +30,7 @@
   : 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 @@
                     ns3::Callback<void, Ptr<Socket> > 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 @@
 {
   if (!m_connected)
     {
-      m_errno = ENOTCONN;
+      m_errno = ERROR_NOTCONN;
       return -1;
     }
   Packet p;
@@ -193,7 +193,7 @@
     }
   if (m_shutdownSend)
     {
-      m_errno = ESHUTDOWN;
+      m_errno = ERROR_SHUTDOWN;
       return -1;
     }
   m_udp->Send (p, m_endPoint->GetLocalAddress (), daddr,
@@ -213,7 +213,7 @@
 {
   if (m_connected)
     {
-      m_errno = EISCONN;
+      m_errno = ERROR_ISCONN;
       return -1;
     }
   Packet p;
--- a/src/node/socket.h	Thu May 17 15:15:56 2007 +0100
+++ b/src/node/socket.h	Thu May 17 15:50:20 2007 +0100
@@ -46,13 +46,13 @@
   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
   };