Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2958)

Unified Diff: sky/engine/wtf/text/WTFString.cpp

Issue 719063002: Revert "Remove support for MSVC" (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/engine/wtf/text/WTFString.cpp
diff --git a/sky/engine/wtf/text/WTFString.cpp b/sky/engine/wtf/text/WTFString.cpp
index dfffa6a21ff7887deff386116f976c7192f653b2..e23f7286a6f66ff9dc3003e4fe0c16ef1dc5c902 100644
--- a/sky/engine/wtf/text/WTFString.cpp
+++ b/sky/engine/wtf/text/WTFString.cpp
@@ -469,6 +469,9 @@ String String::format(const char *format, ...)
Vector<char, 256> buffer;
// Do the format once to get the length.
+#if COMPILER(MSVC)
+ int result = _vscprintf(format, args);
+#else
char ch;
int result = vsnprintf(&ch, 1, format, args);
// We need to call va_end() and then va_start() again here, as the
@@ -479,6 +482,7 @@ String String::format(const char *format, ...)
// systems, but fails e.g. on 64bit Linux.
va_end(args);
va_start(args, format);
+#endif
if (result == 0)
return String("");
@@ -1011,9 +1015,18 @@ static inline IntegralType toIntegralType(const CharType* data, size_t length, b
++data;
}
+#if COMPILER(MSVC)
+#pragma warning(push, 0)
+#pragma warning(disable:4146)
+#endif
+
if (isNegative)
value = -value;
+#if COMPILER(MSVC)
+#pragma warning(pop)
+#endif
+
// skip trailing space
while (length && isSpaceOrNewline(*data)) {
--length;

Powered by Google App Engine
This is Rietveld 408576698