From: Eric Petit Date: Sun, 14 Aug 2005 13:15:38 +0000 (+0000) Subject: ALL: compile fixes X-Git-Tag: 0.8.4~843 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e7440c3ba1ccd9169914d32b8f1b6ca09c7d2d5e;p=vlc ALL: compile fixes --- diff --git a/include/network.h b/include/network.h index ebc712c039..aa2f6cad44 100644 --- a/include/network.h +++ b/include/network.h @@ -399,7 +399,9 @@ int inet_pton(int af, const char *src, void *dst); # define net_StopSend( fd ) (void)shutdown( fd, SD_SEND ) # define net_StopRecv( fd ) (void)shutdown( fd, SD_RECEIVE ) #else -# warning FIXME: implement shutdown on your platform! +# ifndef SYS_BEOS /* R5 just doesn't have a working shutdown() */ +# warning FIXME: implement shutdown on your platform! +# endif # define net_StopSend( fd ) (void)0 # define net_StopRecv( fd ) (void)0 #endif @@ -515,13 +517,13 @@ static inline vlc_bool_t net_AddressIsMulticast( vlc_object_t *p_object, const c && ( ntohl( v4->sin_addr.s_addr ) <= 0xefffffff ); #endif } +#if defined( WIN32 ) || defined( HAVE_GETADDRINFO ) else if( res->ai_family == AF_INET6 ) { -#if defined( WIN32 ) || defined( HAVE_GETADDRINFO ) struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)res->ai_addr; b_multicast = IN6_IS_ADDR_MULTICAST( &v6->sin6_addr ); -#endif } +#endif vlc_freeaddrinfo( res ); return b_multicast; diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c index 5d48cbacde..2b718dee9f 100644 --- a/modules/demux/playlist/m3u.c +++ b/modules/demux/playlist/m3u.c @@ -271,6 +271,7 @@ static void parseEXTINF(char *psz_string, char **ppsz_author, { char *end=NULL; char *psz_item=NULL; + char *pos; end = psz_string + strlen( psz_string ); @@ -299,7 +300,6 @@ static void parseEXTINF(char *psz_string, char **ppsz_author, } /* read the author */ - char *pos; /* parse the author until unescaped comma is reached */ psz_item = pos = psz_string; while( psz_string < end && *psz_string != ',' ) diff --git a/src/misc/net.c b/src/misc/net.c index 9424fd617f..a4148acb55 100644 --- a/src/misc/net.c +++ b/src/misc/net.c @@ -1248,7 +1248,7 @@ int inet_pton(int af, const char *src, void *dst) if( ipv4 == INADDR_NONE ) return -1; - memcpy( dst; &ipv4, 4 ); + memcpy( dst, &ipv4, 4 ); # endif /* WIN32 */ return 0; } diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c index ce7c00e83d..5daec1956c 100644 --- a/src/stream_output/sap.c +++ b/src/stream_output/sap.c @@ -42,7 +42,9 @@ # include #else # include -# include +# ifdef HAVE_ARPA_INET_H +# include +# endif #endif #include "charset.h" @@ -447,8 +449,21 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap, psz_head[2] = (i_hash & 0xFF00) >> 8; /* Msg id hash */ psz_head[3] = (i_hash & 0xFF); /* Msg id hash 2 */ - inet_pton( b_ipv6 ? AF_INET6 : AF_INET, /* can't fail */ - p_sap_session->p_address->psz_machine, psz_head + 4 ); +#if defined (HAVE_INET_PTON) || defined (WIN32) + if( b_ipv6 ) + { + inet_pton( AF_INET6, /* can't fail */ + p_sap_session->p_address->psz_machine, + psz_head + 4 ); + } + else +#else + { + inet_pton( AF_INET, /* can't fail */ + p_sap_session->p_address->psz_machine, + psz_head + 4 ); + } +#endif memcpy( psz_head + (b_ipv6 ? 20 : 8), "application/sdp", 15 );