]> git.sesse.net Git - vlc/commitdiff
ALL: compile fixes
authorEric Petit <titer@videolan.org>
Sun, 14 Aug 2005 13:15:38 +0000 (13:15 +0000)
committerEric Petit <titer@videolan.org>
Sun, 14 Aug 2005 13:15:38 +0000 (13:15 +0000)
include/network.h
modules/demux/playlist/m3u.c
src/misc/net.c
src/stream_output/sap.c

index ebc712c0393ff73de85f8596a297705fc9756c43..aa2f6cad44054ad7d3b185223182a5d575039fdc 100644 (file)
@@ -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;
index 5d48cbacde99a8dd1f8641a2e6343015aab57202..2b718dee9f056ae85a406ec3af8b834a81598a49 100644 (file)
@@ -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 != ',' )
index 9424fd617f473065f0d16163836cb520ff1dcd28..a4148acb556d631a2560571e8b055b400c3c3fed 100644 (file)
@@ -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;
 }
index ce7c00e83d4d744ce07c5b1dc1387aa3199f119c..5daec1956c121ba05810b943c7956d7bf2afc34c 100644 (file)
@@ -42,7 +42,9 @@
 #   include <ws2tcpip.h>
 #else
 #   include <netdb.h>
-#   include <arpa/inet.h>
+#   ifdef HAVE_ARPA_INET_H
+#       include <arpa/inet.h>
+#   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 );