diff --git a/uppsrc/Core/Core.h b/uppsrc/Core/Core.h index ce32439ce..097196705 100644 --- a/uppsrc/Core/Core.h +++ b/uppsrc/Core/Core.h @@ -285,6 +285,12 @@ NAMESPACE_UPP #endif #endif +#ifdef flagOLD_VALUE +#ifdef SVO_VALUE +#undef SVO_VALUE +#endif +#endif + #include "OldValue.h" #include "Value.h" diff --git a/uppsrc/Core/Value.h b/uppsrc/Core/Value.h index 0963a80ac..b312f14b2 100644 --- a/uppsrc/Core/Value.h +++ b/uppsrc/Core/Value.h @@ -260,10 +260,10 @@ inline unsigned ValueGetHashValue(const T& x) { } #define VALUE_COMPARE_V(T, VT) \ -inline bool operator==(const Value& v, T x) { return (VT)v == x; } \ -inline bool operator==(T x, const Value& v) { return (VT)v == x; } \ -inline bool operator!=(const Value& v, T x) { return (VT)v != x; } \ -inline bool operator!=(T x, const Value& v) { return (VT)v != x; } \ +inline bool operator==(const Value& v, T x) { return v.Is() ? (VT)v == x : v == Value(x); } \ +inline bool operator==(T x, const Value& v) { return v.Is() ? (VT)v == x : v == Value(x); } \ +inline bool operator!=(const Value& v, T x) { return v.Is() ? (VT)v != x : v != Value(x); } \ +inline bool operator!=(T x, const Value& v) { return v.Is() ? (VT)v != x : v != Value(x); } \ #define VALUE_COMPARE(T) VALUE_COMPARE_V(T, T)