network: properly declare WSADATA in windows
authorSergey Radionov <RSATom@gmail.com>
Wed, 21 Dec 2011 02:19:10 +0000 (09:19 +0700)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 21 Dec 2011 02:27:19 +0000 (03:27 +0100)
Fixed "ISO C90 forbids mixed declarations and code" in ff_network_init

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/network.c

index f8403ae..bfc34c7 100644 (file)
@@ -123,13 +123,16 @@ int ff_network_inited_globally;
 
 int ff_network_init(void)
 {
+#if HAVE_WINSOCK2_H
+    WSADATA wsaData;
+#endif
+
     if (!ff_network_inited_globally)
         av_log(NULL, AV_LOG_WARNING, "Using network protocols without global "
                                      "network initialization. Please use "
                                      "avformat_network_init(), this will "
                                      "become mandatory later.\n");
 #if HAVE_WINSOCK2_H
-    WSADATA wsaData;
     if (WSAStartup(MAKEWORD(1,1), &wsaData))
         return 0;
 #endif