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

Unified Diff: sky/engine/wtf/TypeTraits.h

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/TypeTraits.h
diff --git a/sky/engine/wtf/TypeTraits.h b/sky/engine/wtf/TypeTraits.h
index c3534a44935e727c04eba06777048cb681ce0c6c..3637304b4680f221d39d09d3591ca9157513150e 100644
--- a/sky/engine/wtf/TypeTraits.h
+++ b/sky/engine/wtf/TypeTraits.h
@@ -61,7 +61,9 @@ namespace WTF {
template<> struct IsInteger<unsigned long> { static const bool value = true; };
template<> struct IsInteger<long long> { static const bool value = true; };
template<> struct IsInteger<unsigned long long> { static const bool value = true; };
+#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
template<> struct IsInteger<wchar_t> { static const bool value = true; };
+#endif
template<typename T> struct IsFloatingPoint { static const bool value = false; };
template<> struct IsFloatingPoint<float> { static const bool value = true; };
@@ -312,8 +314,12 @@ class NeedsTracing {
typedef struct NoType {
char padding[8];
} NoType;
+#if COMPILER(MSVC)
+ template<typename V> static YesType checkHasTraceMethod(char[&V::trace != 0]);
+#else
template<size_t> struct HasMethod;
template<typename V> static YesType checkHasTraceMethod(HasMethod<sizeof(&V::trace)>*);
+#endif // COMPILER(MSVC)
template<typename V> static NoType checkHasTraceMethod(...);
public:
// We add sizeof(T) to both sides here, because we want it to fail for

Powered by Google App Engine
This is Rietveld 408576698