comparison stream/librtsp/rtsp_rtp.c @ 27461:5a30f5bc23a0

Rename HAVE_WINSOCK preprocessor condition to HAVE_WINSOCK_H. This is what it is called in FFmpeg and more consistent with other names for similar conditionals. This fixes a potential compilation failure on MinGW, as described in Bugzilla #1262.
author diego
date Fri, 29 Aug 2008 20:05:08 +0000
parents d788e177a35e
children e16088a911c1
comparison
equal deleted inserted replaced
27460:1b5516898adb 27461:5a30f5bc23a0
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 31 #ifndef 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
248 sin.sin_addr.s_addr = INADDR_ANY; 248 sin.sin_addr.s_addr = INADDR_ANY;
249 sin.sin_port = htons (client_port); 249 sin.sin_port = htons (client_port);
250 250
251 if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) 251 if (bind (s, (struct sockaddr *) &sin, sizeof (sin)))
252 { 252 {
253 #ifndef HAVE_WINSOCK2 253 #ifndef HAVE_WINSOCK2_H
254 if (errno != EINPROGRESS) 254 if (errno != EINPROGRESS)
255 #else 255 #else
256 if (WSAGetLastError() != WSAEINPROGRESS) 256 if (WSAGetLastError() != WSAEINPROGRESS)
257 #endif 257 #endif
258 { 258 {
294 294
295 sin.sin_family = AF_INET; 295 sin.sin_family = AF_INET;
296 if (!hostname || !strcmp (hostname, "0.0.0.0")) 296 if (!hostname || !strcmp (hostname, "0.0.0.0"))
297 sin.sin_addr.s_addr = htonl (INADDR_ANY); 297 sin.sin_addr.s_addr = htonl (INADDR_ANY);
298 else 298 else
299 #ifndef HAVE_WINSOCK2 299 #ifndef HAVE_WINSOCK2_H
300 #ifdef HAVE_ATON 300 #ifdef HAVE_ATON
301 inet_aton (hostname, &sin.sin_addr); 301 inet_aton (hostname, &sin.sin_addr);
302 #else 302 #else
303 inet_pton (AF_INET, hostname, &sin.sin_addr); 303 inet_pton (AF_INET, hostname, &sin.sin_addr);
304 #endif 304 #endif
329 } 329 }
330 330
331 /* datagram socket */ 331 /* datagram socket */
332 if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) 332 if (bind (s, (struct sockaddr *) &sin, sizeof (sin)))
333 { 333 {
334 #ifndef HAVE_WINSOCK2 334 #ifndef HAVE_WINSOCK2_H
335 if (errno != EINPROGRESS) 335 if (errno != EINPROGRESS)
336 #else 336 #else
337 if (WSAGetLastError() != WSAEINPROGRESS) 337 if (WSAGetLastError() != WSAEINPROGRESS)
338 #endif 338 #endif
339 { 339 {
383 if (!addr) 383 if (!addr)
384 return -1; 384 return -1;
385 385
386 sin.sin_family = AF_INET; 386 sin.sin_family = AF_INET;
387 387
388 #ifndef HAVE_WINSOCK2 388 #ifndef HAVE_WINSOCK2_H
389 #ifdef HAVE_ATON 389 #ifdef HAVE_ATON
390 inet_aton (addr, &sin.sin_addr); 390 inet_aton (addr, &sin.sin_addr);
391 #else 391 #else
392 inet_pton (AF_INET, addr, &sin.sin_addr); 392 inet_pton (AF_INET, addr, &sin.sin_addr);
393 #endif 393 #endif