Skip to content

Commit 5a9ec25

Browse files
rh101minggo
authored andcommitted
Fix visual studio console output (#20357)
1 parent 796e09f commit 5a9ec25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cocos/base/CCConsole.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ void log(const char * format, ...)
168168
} while (true);
169169
#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32
170170
buf[nret] = '\n';
171-
#endif
172171
buf[++nret] = '\0';
172+
#else
173+
buf[nret] = '\0';
174+
#endif
173175

174176
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
175177
__android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buf);
@@ -190,6 +192,7 @@ void log(const char * format, ...)
190192

191193
MultiByteToWideChar(CP_UTF8, 0, tempBuf, -1, wszBuf, sizeof(wszBuf));
192194
OutputDebugStringW(wszBuf);
195+
OutputDebugStringW(L"\n");
193196
WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, tempBuf, sizeof(tempBuf), nullptr, FALSE);
194197
#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32
195198
printf("%s", tempBuf);

0 commit comments

Comments
 (0)