@@ -60,7 +60,7 @@ sint32 UDP::Bind(uint32 IP,uint16 Port)
6060 addr.sin_port =Port;
6161 addr.sin_addr .s_addr =IP;
6262 fd=socket (AF_INET,SOCK_DGRAM,DEFAULT_PROTOCOL);
63- #ifdef _WINDOWS
63+ #ifdef _WIN32
6464 if (fd==SOCKET_ERROR)
6565 fd=-1 ;
6666 #endif
@@ -69,7 +69,7 @@ sint32 UDP::Bind(uint32 IP,uint16 Port)
6969
7070 retval=bind (fd,(struct sockaddr *)&addr,sizeof (addr));
7171
72- #ifdef _WINDOWS
72+ #ifdef _WIN32
7373 if (retval==SOCKET_ERROR)
7474 retval=-1 ;
7575 #endif
@@ -104,7 +104,7 @@ bit8 UDP::getLocalAddr(uint32 &ip, uint16 &port)
104104// private function
105105sint32 UDP::SetBlocking (bit8 block)
106106{
107- #if defined(_WINDOWS) || defined( _WIN32) || defined(WIN32)
107+ #ifdef _WIN32
108108 unsigned long flag=1 ;
109109 if (block)
110110 flag=0 ;
@@ -145,7 +145,7 @@ sint32 UDP::Write(uint8 *msg,uint32 len,uint32 IP,uint16 port)
145145
146146 ClearStatus ();
147147 retval=sendto (fd,(char *)msg,len,0 ,(struct sockaddr *)&to,sizeof (to));
148- #ifdef _WINDOWS
148+ #ifdef _WIN32
149149 if (retval==SOCKET_ERROR)
150150 retval=-1 ;
151151 #endif
@@ -161,15 +161,15 @@ sint32 UDP::Read(uint8 *msg,uint32 len,sockaddr_in *from)
161161 if (from!=NULL )
162162 {
163163 retval=recvfrom (fd,(char *)msg,len,0 ,(struct sockaddr *)from,&alen);
164- #ifdef _WINDOWS
164+ #ifdef _WIN32
165165 if (retval==SOCKET_ERROR)
166166 retval=-1 ;
167167 #endif
168168 }
169169 else
170170 {
171171 retval=recvfrom (fd,(char *)msg,len,0 ,NULL ,NULL );
172- #ifdef _WINDOWS
172+ #ifdef _WIN32
173173 if (retval==SOCKET_ERROR)
174174 retval=-1 ;
175175 #endif
@@ -180,14 +180,14 @@ sint32 UDP::Read(uint8 *msg,uint32 len,sockaddr_in *from)
180180
181181void UDP::ClearStatus (void )
182182{
183- #ifndef _WINDOWS
183+ #ifndef _WIN32
184184 errno=0 ;
185185 #endif
186186}
187187
188188UDP::sockStat UDP::GetStatus (void )
189189{
190- #ifdef _WINDOWS
190+ #ifdef _WIN32
191191 int status=WSAGetLastError ();
192192 if (status==0 ) return (OK);
193193 else if (status==WSAEINTR) return (INTR);
@@ -310,7 +310,7 @@ int UDP::Wait(sint32 sec,sint32 usec,fd_set &givenSet,fd_set &returnSet)
310310
311311bit8 UDP::SetInputBuffer (uint32 bytes)
312312{
313- #ifndef _WINDOWS
313+ #ifndef _WIN32
314314 int retval,arg=bytes;
315315
316316 retval=setsockopt (fd,SOL_SOCKET,SO_RCVBUF,
@@ -328,7 +328,7 @@ bit8 UDP::SetInputBuffer(uint32 bytes)
328328
329329bit8 UDP::SetOutputBuffer (uint32 bytes)
330330{
331- #ifndef _WINDOWS
331+ #ifndef _WIN32
332332 int retval,arg=bytes;
333333
334334 retval=setsockopt (fd,SOL_SOCKET,SO_SNDBUF,
@@ -346,7 +346,7 @@ bit8 UDP::SetOutputBuffer(uint32 bytes)
346346
347347int UDP::GetInputBuffer (void )
348348{
349- #ifndef _WINDOWS
349+ #ifndef _WIN32
350350 int retval,arg=0 ,len=sizeof (int );
351351
352352 retval=getsockopt (fd,SOL_SOCKET,SO_RCVBUF,
@@ -360,7 +360,7 @@ int UDP::GetInputBuffer(void)
360360
361361int UDP::GetOutputBuffer (void )
362362{
363- #ifndef _WINDOWS
363+ #ifndef _WIN32
364364 int retval,arg=0 ,len=sizeof (int );
365365
366366 retval=getsockopt (fd,SOL_SOCKET,SO_SNDBUF,
0 commit comments