Commit 139cef8e authored by Sergey Radionov's avatar Sergey Radionov Committed by Luca Barbato

network: properly declare WSADATA in windows

Fixed "ISO C90 forbids mixed declarations and code" in ff_network_init
Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
parent 9f3c77dd
...@@ -123,13 +123,16 @@ int ff_network_inited_globally; ...@@ -123,13 +123,16 @@ int ff_network_inited_globally;
int ff_network_init(void) int ff_network_init(void)
{ {
#if HAVE_WINSOCK2_H
WSADATA wsaData;
#endif
if (!ff_network_inited_globally) if (!ff_network_inited_globally)
av_log(NULL, AV_LOG_WARNING, "Using network protocols without global " av_log(NULL, AV_LOG_WARNING, "Using network protocols without global "
"network initialization. Please use " "network initialization. Please use "
"avformat_network_init(), this will " "avformat_network_init(), this will "
"become mandatory later.\n"); "become mandatory later.\n");
#if HAVE_WINSOCK2_H #if HAVE_WINSOCK2_H
WSADATA wsaData;
if (WSAStartup(MAKEWORD(1,1), &wsaData)) if (WSAStartup(MAKEWORD(1,1), &wsaData))
return 0; return 0;
#endif #endif
......
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