From 602d2715a27d8188c81f3357198f24727c69a797 Mon Sep 17 00:00:00 2001 From: Xiaodong Qi Date: Sun, 29 Nov 2015 00:14:29 +0800 Subject: [PATCH] Fix compilation error under Visual Studio 2010 Visual Studio 2010 use a compiler that supports only C89, which only supports declaring variable at top of a local scope. Moving scope variable to the top of function should solve this problem. --- winpr/libwinpr/utils/wlog/ConsoleAppender.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winpr/libwinpr/utils/wlog/ConsoleAppender.c b/winpr/libwinpr/utils/wlog/ConsoleAppender.c index 49cd94f..a150ae6 100644 --- a/winpr/libwinpr/utils/wlog/ConsoleAppender.c +++ b/winpr/libwinpr/utils/wlog/ConsoleAppender.c @@ -55,10 +55,11 @@ static BOOL WLog_ConsoleAppender_WriteMessage(wLog* log, wLogAppender* appender, { FILE* fp; char prefix[WLOG_MAX_PREFIX_SIZE]; + wLogConsoleAppender *consoleAppender; if (!appender) return FALSE; - wLogConsoleAppender *consoleAppender = (wLogConsoleAppender *)appender; + consoleAppender = (wLogConsoleAppender *)appender; message->PrefixString = prefix; -- 2.7.4