diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index cc661c0c44e790e2538e1134e612a46755a940e2..3c2c63187c3342c242be516dffaf537b25599401 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -621,7 +621,14 @@ struct IntType inline bool operator != (const IntType &o) const { return v != o.v; } static inline int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } inline int cmp (IntType va) const { Type a = va; return cmp (va); } - inline int cmp (Type a) const { Type b = v; return a < b ? -1 : a == b ? 0 : +1; } + inline int cmp (Type a) const + { + Type b = v; + if (sizeof (Type) < sizeof (int)) + return (int) a - (int) b; + else + return a < b ? -1 : a == b ? 0 : +1; + } inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this);