equal
deleted
inserted
replaced
30 /* Windows has some different names for some types */ |
30 /* Windows has some different names for some types */ |
31 typedef unsigned long in_addr_t; |
31 typedef unsigned long in_addr_t; |
32 #endif /* WIN32 */ |
32 #endif /* WIN32 */ |
33 |
33 |
34 /* UNIX stuff */ |
34 /* UNIX stuff */ |
35 #if defined(UNIX) |
35 #if defined(UNIX) && !defined(__OS2__) |
36 # define SOCKET int |
36 # define SOCKET int |
37 # define INVALID_SOCKET -1 |
37 # define INVALID_SOCKET -1 |
38 # if !defined(__MORPHOS__) && !defined(__AMIGA__) |
38 # if !defined(__MORPHOS__) && !defined(__AMIGA__) |
39 # define ioctlsocket ioctl |
39 # define ioctlsocket ioctl |
40 # if !defined(BEOS_NET_SERVER) |
40 # if !defined(BEOS_NET_SERVER) |
148 extern struct MsgPort *TimerPort; |
148 extern struct MsgPort *TimerPort; |
149 extern struct timerequest *TimerRequest; |
149 extern struct timerequest *TimerRequest; |
150 # endif |
150 # endif |
151 #endif // __MORPHOS__ || __AMIGA__ |
151 #endif // __MORPHOS__ || __AMIGA__ |
152 |
152 |
153 static inline bool SetNonBlocking(int d) |
153 static inline bool SetNonBlocking(const int d) |
154 { |
154 { |
155 #ifdef WIN32 |
155 #ifdef WIN32 |
156 u_long nonblocking = 1; |
156 u_long nonblocking = 1; |
157 #else |
157 #else |
158 int nonblocking = 1; |
158 int nonblocking = 1; |
162 #else |
162 #else |
163 return ioctlsocket(d, FIONBIO, &nonblocking) == 0; |
163 return ioctlsocket(d, FIONBIO, &nonblocking) == 0; |
164 #endif |
164 #endif |
165 } |
165 } |
166 |
166 |
167 static inline bool SetNoDelay(int d) |
167 static inline bool SetNoDelay(const int d) |
168 { |
168 { |
169 /* XXX should this be done at all? */ |
169 /* XXX should this be done at all? */ |
170 #if !defined(BEOS_NET_SERVER) // not implemented on BeOS net_server |
170 #if !defined(BEOS_NET_SERVER) // not implemented on BeOS net_server |
171 int b = 1; |
171 int b = 1; |
172 /* The (const char*) cast is needed for windows */ |
172 /* The (const char*) cast is needed for windows */ |