X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_network.h;h=aca2b0a70498e9c721bae34ac3660a30e935d008;hb=5d313c65e44d8963262fdbc5d5d52f5169f3f787;hp=77cb6f0d8b228868084837b072bbfc7c92cd11f8;hpb=9d85c35d50b34f3b7d54f12555ab268c73cb95bc;p=vlc diff --git a/include/vlc_network.h b/include/vlc_network.h index 77cb6f0d8b..aca2b0a704 100644 --- a/include/vlc_network.h +++ b/include/vlc_network.h @@ -24,10 +24,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#if !defined( __LIBVLC__ ) - #error You are not libvlc or one of its plugins. You cannot include this file -#endif - #ifndef __VLC_NETWORK_H # define __VLC_NETWORK_H @@ -59,8 +55,6 @@ struct msghdr int msg_flags; }; -VLC_EXPORT( ssize_t, vlc_sendmsg, ( int, struct msghdr *, int ) ); -VLC_EXPORT( ssize_t, vlc_recvmsg, ( int, struct msghdr *, int ) ); #define sendmsg vlc_sendmsg #define recvmsg vlc_recvmsg @@ -81,6 +75,9 @@ VLC_EXPORT( ssize_t, vlc_recvmsg, ( int, struct msghdr *, int ) ); # define net_errno errno #endif +VLC_EXPORT( ssize_t, vlc_sendmsg, ( int, struct msghdr *, int ) ); +VLC_EXPORT( ssize_t, vlc_recvmsg, ( int, struct msghdr *, int ) ); + # ifdef __cplusplus extern "C" { # endif @@ -154,19 +151,18 @@ VLC_EXPORT( ssize_t, net_Printf, ( vlc_object_t *p_this, int fd, const v_socket_ VLC_EXPORT( ssize_t, __net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args ) ); +/* Don't go to an extra call layer if we have the symbol */ #ifndef HAVE_INET_PTON -/* only in core, so no need for C++ extern "C" */ - VLC_EXPORT (int, inet_pton, (int af, const char *src, void *dst) ); +#define inet_pton vlc_inet_pton #endif - #ifndef HAVE_INET_NTOP -#ifdef WIN32 -/* only in core, so no need for C++ extern "C" */ - VLC_EXPORT (const char *, inet_ntop, (int af, const void *src, - char *dst, socklen_t cnt) ); -#endif +#define inet_ntop vlc_inet_ntop #endif +VLC_EXPORT (int, vlc_inet_pton, (int af, const char *src, void *dst) ); +VLC_EXPORT (const char *, vlc_inet_ntop, (int af, const void *src, + char *dst, socklen_t cnt) ); + #ifndef HAVE_POLL enum { @@ -273,6 +269,10 @@ struct addrinfo # define AI_NUMERICHOST 4 # endif /* if !HAVE_STRUCT_ADDRINFO */ +#ifndef AI_NUMERICSERV +# define AI_NUMERICSERV 0 +#endif + VLC_EXPORT( const char *, vlc_gai_strerror, ( int ) ); VLC_EXPORT( int, vlc_getnameinfo, ( const struct sockaddr *, int, char *, int, int *, int ) ); VLC_EXPORT( int, vlc_getaddrinfo, ( vlc_object_t *, const char *, int, const struct addrinfo *, struct addrinfo ** ) );