comparison stream/librtsp/rtsp_rtp.c @ 28402:c884d17bd005

Convert HAVE_WINSOCK2_H into a 0/1 definition.
author diego
date Sun, 01 Feb 2009 13:42:27 +0000
parents 9202b9245819
children 613f075b4ef0
comparison
equal deleted inserted replaced
28401:e0d9eb28e807 28402:c884d17bd005
26 #include <sys/types.h> 26 #include <sys/types.h>
27 #include <inttypes.h> 27 #include <inttypes.h>
28 28
29 #include "config.h" 29 #include "config.h"
30 30
31 #ifndef HAVE_WINSOCK2_H 31 #if !HAVE_WINSOCK2_H
32 #include <netdb.h> 32 #include <netdb.h>
33 #include <netinet/in.h> 33 #include <netinet/in.h>
34 #include <sys/socket.h> 34 #include <sys/socket.h>
35 #include <arpa/inet.h> 35 #include <arpa/inet.h>
36 #else 36 #else
249 sin.sin_addr.s_addr = INADDR_ANY; 249 sin.sin_addr.s_addr = INADDR_ANY;
250 sin.sin_port = htons (client_port); 250 sin.sin_port = htons (client_port);
251 251
252 if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) 252 if (bind (s, (struct sockaddr *) &sin, sizeof (sin)))
253 { 253 {
254 #ifndef HAVE_WINSOCK2_H 254 #if !HAVE_WINSOCK2_H
255 if (errno != EINPROGRESS) 255 if (errno != EINPROGRESS)
256 #else 256 #else
257 if (WSAGetLastError() != WSAEINPROGRESS) 257 if (WSAGetLastError() != WSAEINPROGRESS)
258 #endif 258 #endif
259 { 259 {
295 295
296 sin.sin_family = AF_INET; 296 sin.sin_family = AF_INET;
297 if (!hostname || !strcmp (hostname, "0.0.0.0")) 297 if (!hostname || !strcmp (hostname, "0.0.0.0"))
298 sin.sin_addr.s_addr = htonl (INADDR_ANY); 298 sin.sin_addr.s_addr = htonl (INADDR_ANY);
299 else 299 else
300 #ifndef HAVE_WINSOCK2_H 300 #if !HAVE_WINSOCK2_H
301 #if HAVE_INET_ATON 301 #if HAVE_INET_ATON
302 inet_aton (hostname, &sin.sin_addr); 302 inet_aton (hostname, &sin.sin_addr);
303 #else 303 #else
304 inet_pton (AF_INET, hostname, &sin.sin_addr); 304 inet_pton (AF_INET, hostname, &sin.sin_addr);
305 #endif 305 #endif
330 } 330 }
331 331
332 /* datagram socket */ 332 /* datagram socket */
333 if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) 333 if (bind (s, (struct sockaddr *) &sin, sizeof (sin)))
334 { 334 {
335 #ifndef HAVE_WINSOCK2_H 335 #if !HAVE_WINSOCK2_H
336 if (errno != EINPROGRESS) 336 if (errno != EINPROGRESS)
337 #else 337 #else
338 if (WSAGetLastError() != WSAEINPROGRESS) 338 if (WSAGetLastError() != WSAEINPROGRESS)
339 #endif 339 #endif
340 { 340 {
384 if (!addr) 384 if (!addr)
385 return -1; 385 return -1;
386 386
387 sin.sin_family = AF_INET; 387 sin.sin_family = AF_INET;
388 388
389 #ifndef HAVE_WINSOCK2_H 389 #if !HAVE_WINSOCK2_H
390 #if HAVE_INET_ATON 390 #if HAVE_INET_ATON
391 inet_aton (addr, &sin.sin_addr); 391 inet_aton (addr, &sin.sin_addr);
392 #else 392 #else
393 inet_pton (AF_INET, addr, &sin.sin_addr); 393 inet_pton (AF_INET, addr, &sin.sin_addr);
394 #endif 394 #endif