Commit 413b31ee authored by Eric Petit's avatar Eric Petit

src/*: BeOS compile fixes

 configure.ac: access_ftp now requires -lnet on BeOS
parent f95fc88f
...@@ -187,7 +187,7 @@ case "${target_os}" in ...@@ -187,7 +187,7 @@ case "${target_os}" in
VLC_ADD_CXXFLAGS([beos],[]) VLC_ADD_CXXFLAGS([beos],[])
VLC_ADD_LDFLAGS([vlc beos],[-lbe]) VLC_ADD_LDFLAGS([vlc beos],[-lbe])
VLC_ADD_LDFLAGS([beos],[-lmedia -ltranslation -ltracker -lgame]) VLC_ADD_LDFLAGS([beos],[-lmedia -ltranslation -ltracker -lgame])
VLC_ADD_LDFLAGS([access_file access_mms access_output_udp telnet netsync sap ipv4 vlc],[-lnet]) VLC_ADD_LDFLAGS([access_file access_ftp access_mms access_output_udp telnet netsync sap ipv4 vlc],[-lnet])
dnl Ugly check for Zeta dnl Ugly check for Zeta
if test -f /boot/beos/system/lib/libzeta.so; then if test -f /boot/beos/system/lib/libzeta.so; then
......
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
# include <netdb.h> # include <netdb.h>
#endif #endif
#ifdef SYS_BEOS
#define NO_ADDRESS NO_DATA
#define PF_INET AF_INET
#define INADDR_NONE 0xFFFFFFFF
#define AF_UNSPEC 0
#endif
#define _NI_MASK (NI_NUMERICHOST|NI_NUMERICSERV|NI_NOFQDN|NI_NAMEREQD|\ #define _NI_MASK (NI_NUMERICHOST|NI_NUMERICSERV|NI_NOFQDN|NI_NAMEREQD|\
NI_DGRAM) NI_DGRAM)
...@@ -202,6 +208,8 @@ __getnameinfo( const struct sockaddr *sa, socklen_t salen, ...@@ -202,6 +208,8 @@ __getnameinfo( const struct sockaddr *sa, socklen_t salen,
if (serv != NULL) if (serv != NULL)
{ {
struct servent *sent = NULL; struct servent *sent = NULL;
#ifndef SYS_BEOS /* No getservbyport() */
int solved = 0; int solved = 0;
/* service name resolution */ /* service name resolution */
...@@ -218,6 +226,9 @@ __getnameinfo( const struct sockaddr *sa, socklen_t salen, ...@@ -218,6 +226,9 @@ __getnameinfo( const struct sockaddr *sa, socklen_t salen,
solved = 1; solved = 1;
} }
} }
#else
sent = NULL;
#endif
if (sent == NULL) if (sent == NULL)
{ {
snprintf (serv, servlen, "%u", snprintf (serv, servlen, "%u",
...@@ -289,7 +300,7 @@ makeaddrinfo (int af, int type, int proto, ...@@ -289,7 +300,7 @@ makeaddrinfo (int af, int type, int proto,
} }
} }
/* failsafe */ /* failsafe */
freeaddrinfo (res); vlc_freeaddrinfo (res);
return NULL; return NULL;
} }
...@@ -352,7 +363,9 @@ __getaddrinfo (const char *node, const char *service, ...@@ -352,7 +363,9 @@ __getaddrinfo (const char *node, const char *service,
protocol = IPPROTO_UDP; protocol = IPPROTO_UDP;
break; break;
#ifndef SYS_BEOS
case SOCK_RAW: case SOCK_RAW:
#endif
case 0: case 0:
break; break;
...@@ -544,10 +557,12 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node, ...@@ -544,10 +557,12 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
if( val.b_bool ) if( val.b_bool )
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
#ifdef HAVE_INET_PTON
var_Create( p_this, "ipv6", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_this, "ipv6", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_this, "ipv6", &val ); var_Get( p_this, "ipv6", &val );
if( val.b_bool ) if( val.b_bool )
hints.ai_family = AF_INET6; hints.ai_family = AF_INET6;
#endif
} }
/* /*
......
...@@ -457,7 +457,7 @@ int *__net_ListenTCP( vlc_object_t *p_this, const char *psz_host, int i_port ) ...@@ -457,7 +457,7 @@ int *__net_ListenTCP( vlc_object_t *p_this, const char *psz_host, int i_port )
} }
} }
freeaddrinfo( res ); vlc_freeaddrinfo( res );
return pi_handles; return pi_handles;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment