Skip to content

Commit 0d41ade

Browse files
KAndQminggo
authored andcommitted
Unify the effect of printing multiline logs.
Now all platforms will have the same lines.
1 parent e43ed60 commit 0d41ade

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cocos/base/CCConsole.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ void log(const char * format, ...)
166166
delete[] buf;
167167
}
168168
} while (true);
169+
#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32
169170
buf[nret] = '\n';
171+
#endif
170172
buf[++nret] = '\0';
171173

172174
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
@@ -189,8 +191,11 @@ void log(const char * format, ...)
189191
MultiByteToWideChar(CP_UTF8, 0, tempBuf, -1, wszBuf, sizeof(wszBuf));
190192
OutputDebugStringW(wszBuf);
191193
WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, tempBuf, sizeof(tempBuf), nullptr, FALSE);
194+
#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32
192195
printf("%s", tempBuf);
193-
196+
#else
197+
printf("%s\n", tempBuf);
198+
#endif
194199
pos += dataSize;
195200

196201
} while (pos < len);

0 commit comments

Comments
 (0)