]> git.sesse.net Git - vlc/blobdiff - src/network/getaddrinfo.c
macosx: Fix addNode:.
[vlc] / src / network / getaddrinfo.c
index baeefb285cedd8fb62ad347190da14a80cc63943..b57f8caf191196d409aa60891f8c7da5957b350b 100644 (file)
@@ -26,7 +26,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 
 #include <stddef.h> /* size_t */
 #include <string.h> /* strlen(), memcpy(), memset(), strchr() */
@@ -107,7 +107,7 @@ const char *vlc_gai_strerror (int errnum)
                   NI_DGRAM)
 /*
  * getnameinfo() non-thread-safe IPv4-only implementation,
- * Address-family-independant address to hostname translation
+ * Address-family-independent address to hostname translation
  * (reverse DNS lookup in case of IPv4).
  *
  * This is meant for use on old IP-enabled systems that are not IPv6-aware,
@@ -281,7 +281,7 @@ makeipv4info (int type, int proto, u_long ip, u_short port, const char *name)
 
 /*
  * getaddrinfo() non-thread-safe IPv4-only implementation
- * Address-family-independant hostname to address resolution.
+ * Address-family-independent hostname to address resolution.
  *
  * This is meant for IPv6-unaware systems that do probably not provide
  * getaddrinfo(), but still have old function gethostbyname().
@@ -591,9 +591,7 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
             AI_PASSIVE |
             AI_CANONNAME |
             AI_NUMERICHOST |
-#ifdef AI_NUMERICSERV
             AI_NUMERICSERV |
-#endif
 #ifdef AI_ALL
             AI_ALL |
 #endif
@@ -615,10 +613,8 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
         hints.ai_flags = p_hints->ai_flags & safe_flags;
     }
 
-#ifdef AI_NUMERICSERV
     /* We only ever use port *numbers* */
     hints.ai_flags |= AI_NUMERICSERV;
-#endif
 
     if( hints.ai_family == AF_UNSPEC )
     {
@@ -674,8 +670,7 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
         hints.ai_flags &= ~AI_NUMERICHOST;
     }
 #endif
-#if defined (HAVE_GETADDRINFO)
-# ifdef AI_IDN
+#ifdef AI_IDN
     /* Run-time I18n Domain Names support */
     hints.ai_flags |= AI_IDN;
     int ret = getaddrinfo (psz_node, psz_service, &hints, res);
@@ -684,20 +679,8 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
 
     /* IDN not available: disable and retry without it */
     hints.ai_flags &= ~AI_IDN;
-# endif
-    return getaddrinfo (psz_node, psz_service, &hints, res);
-#else
-    int ret;
-    vlc_value_t lock;
-
-    var_Create (p_this->p_libvlc, "getaddrinfo_mutex", VLC_VAR_MUTEX);
-    var_Get (p_this->p_libvlc, "getaddrinfo_mutex", &lock);
-    vlc_mutex_lock (lock.p_address);
-
-    ret = getaddrinfo (psz_node, psz_service, &hints, res);
-    vlc_mutex_unlock (lock.p_address);
-    return ret;
 #endif
+    return getaddrinfo (psz_node, psz_service, &hints, res);
 }