]> git.sesse.net Git - vlc/blobdiff - src/misc/getaddrinfo.c
* all: compilation fix with vc7.1 compiler, and removed a bunch of warnings (there...
[vlc] / src / misc / getaddrinfo.c
index 157a292754b6554446aeb237bfa20b629a1c07de..6002a4ec5961ce9b60f76c662d5939087d3be5e8 100644 (file)
@@ -500,6 +500,16 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
 {
     char psz_servbuf[6], *psz_serv;
     int i_servlen, i_val;
+#ifdef WIN32
+    /*
+     * Here is the kind of kludge you need to keep binary compatibility among
+     * varying OS versions...
+     */
+    typedef int (CALLBACK * GETNAMEINFO) ( const struct sockaddr*, socklen_t,
+                                           char*, DWORD, char*, DWORD, int );
+    HINSTANCE wship6_module;
+    GETNAMEINFO ws2_getnameinfo;
+#endif
 
     flags |= NI_NUMERICSERV;
     if( portnum != NULL )
@@ -512,16 +522,7 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
         psz_serv = NULL;
         i_servlen = 0;
     }
-#ifdef WIN32
-    /*
-     * Here is the kind of kludge you need to keep binary compatibility among
-     * varying OS versions...
-     */
-    typedef int (CALLBACK * GETNAMEINFO) ( const struct sockaddr*, socklen_t,
-                                           char*, DWORD, char*, DWORD, int );
-    HINSTANCE wship6_module;
-    GETNAMEINFO ws2_getnameinfo;
-     
+#ifdef WIN32    
     wship6_module = LoadLibrary( "wship6.dll" );
     if( wship6_module != NULL )
     {
@@ -554,7 +555,7 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
          * gethostbyaddr and the likes */
         vlc_mutex_lock( lock.p_address );
 #else
-# warning FIXME : This is not thread-safe!
+//# warning FIXME : This is not thread-safe!
 #endif
         i_val = __getnameinfo( sa, salen, host, hostlen, psz_serv, i_servlen,
                                flags );